Skip to content

In-App Update is not showing #42

@FoloosiApps

Description

@FoloosiApps

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
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions