首页 > 编程语言 >uniapp 小程序 APP 退出应用

uniapp 小程序 APP 退出应用

时间:2022-09-07 17:25:19浏览次数:67  
标签:uniapp ios APP 程序 js platform getSystemInfoSync

APP端:

if (uni.getSystemInfoSync().platform == 'ios'){
    plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
} else if (uni.getSystemInfoSync().platform == 'android'){
    plus.runtime.quit();
}

小程序(按钮形式):

<navigator target="miniProgram" open-type="exit">退出小程序</navigator>

小程序(js):

//在需要退出小程序的地方调用添加下面代码即可(js文件中)
                wx.exitMiniProgram({
                    success: (res) => {}
                })

 

标签:uniapp,ios,APP,程序,js,platform,getSystemInfoSync
From: https://www.cnblogs.com/2865----yyyy/p/16666561.html

相关文章