微信小程序能唤起APP吗?首先回答:可以的,但是受限使用场景。
实现方式
微信没有提供API,通过button中open-type设置为launchApp来实现跳转APP。
它可以传递的参数:
-
可以通过app-parameter属性设定向APP传的参数,app根据传的参数跳转APP不同页面;
-
binderror:当使用开放能力时,发生错误的回调,open-type=launchApp时有效
-
bindlaunchapp:打开 APP 成功的回调,open-type=launchApp时有效
限制唤起APP场景
根据官方描述只能实现APP跳转小程序后,小程序才能回调APP,场景值是1069时有效。官方描述为:当小程序从 APP 打开的场景打开时(场景值 1069),小程序会获得返回 APP 的能力,此时用户点击按钮可以打开拉起该小程序的 APP。即小程序不能打开任意 APP,只能 跳回
APP。
实现
JS
const URLSCHEME = 'weixin://';
Component({
properties: {
targetAppUrl: {
type: String,
value: ''
},
textButton: {
type: Boolean,