修改app升级的平台的包名

This commit is contained in:
1147192855@qq.com 2025-03-17 10:39:19 +08:00
parent 2595bf491e
commit db01a953c2
2 changed files with 7 additions and 6 deletions

View File

@ -87,12 +87,12 @@ class DownloadApk {
//
// await SystemNavigator.pop(); // 退APP
var options = ['应用市场更新APP', '浏览器下载并安装APP'];
var uri = Uri.parse('market://details?id=com.example.marking_app'); // URI
var uri = Uri.parse('market://details?id=${event.packageName}'); // URI
if (!await canLaunchUrl(uri)) options.removeAt(0); //
String? option = await UpgradePermission.showCustomModalBottomSheet(context, options);
if (option == '应用市场更新APP') await launchUrl(uri);
if (option == '浏览器下载并安装APP') await launchUrl(Uri.parse(event.link));
} catch (e) {}
} catch (_) {}
});
print('安装执行完成了..............0.0');

View File

@ -77,14 +77,15 @@ class UpgradePermission {
//
// await SystemNavigator.pop(); // 退APP
var options = ['应用市场更新APP', '浏览器下载并安装APP'];
var uri = Uri.parse('market://details?id=com.example.marking_app'); // URI
var uri = Uri.parse('market://details?id=${updateAppEvent.packageName}'); // URI
// if (!await canLaunchUrl(uri)) options.removeAt(0); //
String? option = await showCustomModalBottomSheet(context, options);
if (option == '应用市场更新APP') {
if (await canLaunchUrl(uri))
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
else
await AppInstaller.goStore('com.example.marking_app', 'iOSAppId');
} else {
await AppInstaller.goStore(updateAppEvent.packageName, 'iOSAppId');
}
}
if (option == '浏览器下载并安装APP') await launchUrl(Uri.parse(updateAppEvent.link));
} else