修改app升级的平台的包名
This commit is contained in:
parent
2595bf491e
commit
db01a953c2
|
|
@ -87,12 +87,12 @@ class DownloadApk {
|
||||||
// 其他方式下载
|
// 其他方式下载
|
||||||
// await SystemNavigator.pop(); // 退出APP
|
// await SystemNavigator.pop(); // 退出APP
|
||||||
var options = ['应用市场更新APP', '浏览器下载并安装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); // 如果不能打开应用市场 就屏蔽掉 这个安装方式
|
if (!await canLaunchUrl(uri)) options.removeAt(0); // 如果不能打开应用市场 就屏蔽掉 这个安装方式
|
||||||
String? option = await UpgradePermission.showCustomModalBottomSheet(context, options);
|
String? option = await UpgradePermission.showCustomModalBottomSheet(context, options);
|
||||||
if (option == '应用市场更新APP') await launchUrl(uri);
|
if (option == '应用市场更新APP') await launchUrl(uri);
|
||||||
if (option == '浏览器下载并安装APP') await launchUrl(Uri.parse(event.link));
|
if (option == '浏览器下载并安装APP') await launchUrl(Uri.parse(event.link));
|
||||||
} catch (e) {}
|
} catch (_) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
print('安装执行完成了..............0.0');
|
print('安装执行完成了..............0.0');
|
||||||
|
|
|
||||||
|
|
@ -77,14 +77,15 @@ class UpgradePermission {
|
||||||
// 其他方式下载
|
// 其他方式下载
|
||||||
// await SystemNavigator.pop(); // 退出APP
|
// await SystemNavigator.pop(); // 退出APP
|
||||||
var options = ['应用市场更新APP', '浏览器下载并安装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); // 如果不能打开应用市场 就屏蔽掉 这个安装方式
|
// if (!await canLaunchUrl(uri)) options.removeAt(0); // 如果不能打开应用市场 就屏蔽掉 这个安装方式
|
||||||
String? option = await showCustomModalBottomSheet(context, options);
|
String? option = await showCustomModalBottomSheet(context, options);
|
||||||
if (option == '应用市场更新APP') {
|
if (option == '应用市场更新APP') {
|
||||||
if (await canLaunchUrl(uri))
|
if (await canLaunchUrl(uri)) {
|
||||||
await launchUrl(uri);
|
await launchUrl(uri);
|
||||||
else
|
} else {
|
||||||
await AppInstaller.goStore('com.example.marking_app', 'iOSAppId');
|
await AppInstaller.goStore(updateAppEvent.packageName, 'iOSAppId');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (option == '浏览器下载并安装APP') await launchUrl(Uri.parse(updateAppEvent.link));
|
if (option == '浏览器下载并安装APP') await launchUrl(Uri.parse(updateAppEvent.link));
|
||||||
} else
|
} else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue