openAppStore method
Future<bool>
openAppStore(
- String str, {
- String? marketPackageName,
- LaunchMode mode = LaunchMode.platformDefault,
- WebViewConfiguration webViewConfiguration = const WebViewConfiguration(),
- String? webOnlyWindowName,
ios str
对应app id
ios str
corresponds to the APP ID
macOS str
对应app id
macOS str
corresponds to the APP ID
android str
对应 packageName,安装多个应用商店时会弹窗选择, marketPackageName 指定打开应用市场的包名
Android str
corresponds to packageName, which is selected when multiple app stores are installed. "marketPackageName" specifies the name of the package to open the app Market
Implementation
Future<bool> openAppStore(
String str, {
String? marketPackageName,
LaunchMode mode = LaunchMode.platformDefault,
WebViewConfiguration webViewConfiguration = const WebViewConfiguration(),
String? webOnlyWindowName,
}) async {
if (isIOS || isMacOS) {
final String url = 'itms-apps://itunes.apple.com/us/app/$str';
return await openUrl(url,
mode: mode,
webOnlyWindowName: webOnlyWindowName,
webViewConfiguration: webViewConfiguration);
} else if (isAndroid) {
return await Curiosity()
.native
.openAndroidAppMarket(str, marketPackageName: marketPackageName);
}
return false;
}