-
Notifications
You must be signed in to change notification settings - Fork 103
Open
Description
Hi,
The new_version_plus plugin was integrated into my flutter app for Android and iOS in-app updates. In iOS builds, sometimes the In-app update popup does not appear. Could you please guide this case?
I mentioned my source code in below:
@override
void initState() {
WidgetsBinding.instance.addObserver(this);
inAppUpdateFlowCheck();
super.initState();
}
Future<void> inAppUpdateFlowCheck() async {
bool isOnline = await Utility().hasNetwork();
if (isOnline) {
final newVersion = NewVersionPlus(
iOSId: 'com.example.app',
androidId: 'com.example.app,
androidHtmlReleaseNotes: true,
);
basicStatusCheck(newVersion);
} else {
var data = {"errorName": "No Internet Connection"};
Get.toNamed(PageNamesList.commonErrorPage, parameters: data);
}
}
basicStatusCheck(NewVersionPlus newVersion) async {
try {
final version = await newVersion.getVersionStatus();
if (version != null) {
release = version.releaseNotes ?? "";
String localVersion = version.localVersion;
String appStoreVersion = version.storeVersion;
bool updateStatus = version.canUpdate;
debugPrint("localVersion - $localVersion");
debugPrint("appStoreVersion - $appStoreVersion");
if (updateStatus) {
newVersion.showUpdateDialog(
context: Get.context!,
versionStatus: version,
dialogTitle: 'Update Available',
dialogText:
'Features:\nUI enhancements have been added for a smoother experience.',
updateButtonText: 'Update',
allowDismissal: true,
dismissButtonText: 'Close',
dismissAction: () => appClose(),
launchModeVersion: LaunchModeVersion.external,
);
} else {
// No Inapp Update
}
}
} catch (e) {
// Error
}
}
najiezzeldien
Metadata
Metadata
Assignees
Labels
No labels