Android 接入 支付宝芝麻信用互查
个人笔记 防止忘记
之前H5调用芝麻授权可以 但是随着芝麻分功能计划下架 需要接入作为新产品的 芝麻信用互查
无奈文档有点少 只能东拼西凑的去找有关于旧版的一些代码片段并且和蚂蚁金服的机器人聊天。
APP唤起支付宝并且不是支付的代码 (重点 : 不是支付)
if (hasApplication()) {
Intent action = new Intent(Intent.ACTION_VIEW);
StringBuilder builder = new StringBuilder();
// 这里使用固定appid 20000067
builder.append("alipays://platformapi/startapp?appId=20000067&url=");
builder.append(URLEncoder.encode(url));
action.setData(Uri.parse(builder.toString()));
startActivity(action);
} else {
// 处理没有安装支付宝的情况
new AlertDialog.Builder(getActivity())
.setMessage("是否下载并安装支付宝完成认证?")
.setPositiveButton("好的", new DialogInterface.OnClickListener() {
@Override