【发布时间】:2021-10-09 15:21:42
【问题描述】:
在此代码中,当我单击按钮时,它总是打开 https://apps.apple.com URL 而不是打开 App Store。我想实现,如果应用程序未安装在设备中,那么它应该只去 App Store,否则它应该打开这个 URL:https://apps.apple.com。
popover.onDidDismiss()
.then(async (decision) => {
if (exiStatus.status === 'registered' && decision.data) {
const options: AppLauncherOptions = {}
if (this.platform.is('ios')) {
options.uri = 'exiapp://referral'
} else {
options.packageName = 'com.iprescribeexercise.app.android.iPrescribe'
}
this.appLauncher.canLaunch(options)
.then((canLaunch: boolean) => {
this.appLauncher.launch(options);
})
.catch((error: any) => {
if (this.platform.is('ios')) {
window.open('https://apps.apple.com')
} else {
window.open('https://play.google.com/store/apps/details?id=com.iprescribeexercise.app.android.iPrescribe')
}
});
【问题讨论】:
标签: angular ionic-framework deep-linking