5.11数字货币H5调用说明


payinfo处理:

(1)H5调用

1.先将payinfo做base64解码,解码后的内容是一段html内容
var html = base64decode(payinfo);
2.在H5页面上输出该html内容
window.location.href = "var html "

(2)APP调用

1.先现将payinfo做base64解码,解码后的内容是一段html内容,
schemeUrl = new String(Base64.decode(success.getPayinfo().getBytes()));
2.判断是否安装APP,如果已安装则直接通过schemeUrl 跳转,未安装则提示安装
Uri parse = Uri.parse(schemeUrl);
Intent intent = new Intent(Intent.ACTION_VIEW, parse);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (Utils.canJump(MainActivity.this, intent)) {
startActivity(intent);
schemeUrl = null;
} else {
Toast.makeText(MainActivity.this, "请先安装相关应用", Toast.LENGTH_SHORT).show();
}


yinjr 2024年7月29日 15:31 收藏文档