Flutter automatically update application when new version is available

前端 未结 5 1875
轮回少年
轮回少年 2021-02-05 17:14

How can I implement auto-updating of my application when a new version is released without using Google Play Store? I\'m using JSON to check the version.

5条回答
  •  無奈伤痛
    2021-02-05 18:15

    It's not possible without using the google play store if you want an automatic update.

    • You need to handle the versioning yourself by hosting the apks somewhere (say github for example) and check if a new version exists and prompt the user whether they want to update the app.
    • Then download the new apk in the background. (You can use this package)
    • Then open the apk when it's done downloading using one of the methods mentioned here
    • Which will then prompt the user whether to allow installing apks from your app

    A plugin exists if you want to do it using the play store. in_app_update Which wraps the android in-app update functionality s 2

    Their official example on github

    If you also want an iOS solution, then it's not possible. You could redirect the user to the AppStore. Some more info on the distribution methods available for apple apps.

    There is this method which might work if you have an enterprise license.

    Whereas if you have a server running, have an endpoint to query the latest versions and another endpoint that allows users to download the apk.

    Use something like github releases if you don't have a server.

提交回复
热议问题