I created an update window and I used snapchat as test app to force an update. Im developing on an iPhone 14 simulator running iOS 16.2. Im getting Unhandled Exception: PlatformException(Error, Error while launching https://apps.apple.com/de/app/snapchat/id447188370?uo=4, null, null) when clicking the update button, but the link is correct. Below is the code im using leaving out the UI part which is not relevant:
String? version = '';
String? storeVersion = '';
String? storeUrl = '';
String? packageName = '';
final versionCheck = VersionCheck(
packageName: Platform.isIOS
? 'com.toyopagroup.picaboo'
: '',
packageVersion: '12.0.0',
showUpdateDialog: customShowUpdateDialog,
country: 'DE',
);
Future checkVersion() async {
await versionCheck.checkVersion(context);
setState(() {
version = versionCheck.packageVersion;
packageName = versionCheck.packageName;
storeVersion = versionCheck.storeVersion;
storeUrl = versionCheck.storeUrl;
});
print(version);
print(packageName);
print(storeVersion);
print(storeUrl);
}
@override
void initState() {
super.initState();
checkVersion();
}
flutter: 12.0.0
flutter: com.toyopagroup.picaboo
flutter: 12.20.0.32
flutter: https://apps.apple.com/de/app/snapchat/id447188370?uo=4
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(Error, Error while launching https://apps.apple.com/de/app/snapchat/id447188370?uo=4, null, null)
#0 StandardMethodCodec.decodeEnvelope
message_codecs.dart:653
#1 MethodChannel._invokeMethod
platform_channel.dart:296
<asynchronous suspension>
#2 VersionCheck.launchStore
version_check.dart:98
<asynchronous suspension>
#3 customShowUpdateDialog.<anonymous closure>.<anonymous closure>
app_wrapper.dart:149
<asynchronous suspension>