ofload / native_updater

Flutter package to embed native in-app updater
MIT License
56 stars 48 forks source link

Add support for checking for versions #13

Closed felix-barz-brickmakers closed 3 years ago

felix-barz-brickmakers commented 3 years ago

It would be awesome if the library could also support a basic update check, using the "standard" APIs, i.e. google play and the iTunes store. To support this, the following would have to be done.

NativeUpdater.checkForUpdates( BuildContext context, { UpdateLevel Function(int, int) androidCompareVersion, // compare version code aka. build number UpdateLevel Function(String, String) iosCompareVersion, // compare version string // other parameters from displayUpdateAlert, except forceUpdate, which is replaced by the UpdateLevel result });



We need two methods for comparing, because on android, the version code / build number is used by google play, while on iOS the actual public version string is used.
milhomem commented 3 years ago

Hi, @felix-barz-brickmakers, I see your point but this is out of the scope proposed by this library.

We believe that it's up to the developer to decide when or how to define when the update is needed. Not always you want to update the app as soon a new version is available. Some might want to control this via API or by some business rule that gives their users the best experience with less disruption.

Although I understand that some might want to use the app versions to trigger updates, this is already provided by the platforms natively.

We would happily accept this second helper entrypoint if you/someone can provide a PR for it, but it's not something you should expect us to work on.