uni-app 在苹果Safari浏览器或安卓中使用schema地址打开app时无法获取参数 plus.runtime.arguments;
uni-app 在苹果Safari浏览器或安卓中使用schema地址打开app时无法获取参数 plus.runtime.arguments;
| 开发环境 | 版本号 | 项目创建方式 |
|---|---|---|
| HBuilderX | 3.3.2 |
产品分类:HTML5+
测试过的手机:
iphone7plus,redmi 8A操作步骤:
wap2app 设置schema 使用浏览器输入schema 获取参数 `com.petropub.cnoocforum://ebank.dgcb.com.cn:8040/mbank/T_DECD_YYRG.hsml?sjyhFlag=75&decd_certno=BOD201905Y013A`预期结果:
``` plus.runtime.launcher=schema var args= plus.runtime.arguments; args=com.petropub.cnoocforum://ebank.dgcb.com.cn:8040/mbank/T_DECD_YYRG.hsml?sjyhFlag=75&decd_certno=BOD201905Y013A ```实际结果:
``` plus.runtime.launcher=default var args= plus.runtime.arguments; args=空 ```bug描述:
``` 苹果safari浏览器中使用shcema地址 (com.petropub.cnoocforum://ebank.dgcb.com.cn:8040/mbank/T_DECD_YYRG.hsml?sjyhFlag=75&decd_certno=BOD201905Y013A)打开app(app正常打开)但是获取不到参数 ```if (window.plus) {
plusReady()
} else {
document.addEventListener('plusready', plusReady, false)
}
function plusReady() {
checkArguments();
}
// 处理从后台恢复
document.addEventListener('newintent',function(){
console.log("addEventListener: newintent");
alert("addEventListener: newintent");
checkArguments();
},false);
// 判断启动方式
function checkArguments(){
// console.log("plus.runtime.launcher: "+plus.runtime.launcher);
alert("plus.runtime.launcher: "+plus.runtime.launcher);
var args= plus.runtime.arguments;
alert("参数:"+args);
if(args){
// 处理args参数,如直达到某新页面等
alert(args);
}
}
获取结果
plus.runtime.launcher:default//这里打开类型应为schema获取的结果确是default
var args= plus.runtime.arguments;
args等于空
更多关于uni-app 在苹果Safari浏览器或安卓中使用schema地址打开app时无法获取参数 plus.runtime.arguments;的实战教程也可以访问 https://www.itying.com/category-93-b0.html

