uni-app APP端调起微信扫一扫

刘小江
2021-04-28 / 0 评论 / 53 阅读 / 正在检测是否收录...
if(plus.os.name == "iOS"){
    plus.runtime.openURL("weixin://scanqrcode");
}else{
    var Intent = plus.android.importClass("android.content.Intent");
    var ComponentName = plus.android.importClass('android.content.ComponentName')
    var intent = new Intent();
    intent.setComponent(new ComponentName("com.tencent.mm", "com.tencent.mm.ui.LauncherUI"));
    intent.putExtra("LauncherUI.From.Scaner.Shortcut", true);
    intent.setFlags(335544320);
    intent.setAction("android.intent.action.VIEW");
    var main = plus.android.runtimeMainActivity();
    main.startActivity(intent);
}
3

评论 (0)

取消