Search code examples
ionic-frameworkionic-native

Check if my ionic app has a new version on AppStore and PlayStore


I would like to add functionality to my Ionic based application to check the respective app store for a newer version, and if present, prompt the user to download once (not repeatedly- they should be able to skip and not be nagged). Similar to Siren, but for Ionic and both Google Play and Apple App Store. I see this similar request for native apps and AppStore and this similar request for Play Store, but nothing specific to Ionic. I feel like I could stitch it together using App Version and ajax calls listed from those requests, but that there has to be other people who have done this already and have existing Cordova/Capacitor plugins for this. Also that there may be nuance that a naive solution could fail (ie ajax call fails, app stores change API, newer version is not supported on device, etc).

Is there an existing plugin or code that will implement the behavior described above?


Solution

  • You can use Market plugin in addition to the App version plugin..

    I haven't come across a solution which directly checks the app store, instead i have to maintain the app version in my server db and check it at app start.

    Here is the flow that can be used..

    1. App Launches
    2. Checks the current app version using APP VERSION plugin
    3. Calls an API endpoint to my server to compare for the deployed app store version (which is maintained in the db)
    4. If the app version is outdated, use the MARKET plugin to take the user to the app store.

    A Capacitor alternative to the market plugin is there, but didn't test it out. Follow Capacitor plugins proposals, for an upcoming solution.