jonasbark / flutter_in_app_update

Flutter Plugin: Enables In App Updates on Android using the official Android APIs.
Other
321 stars 80 forks source link

Fix updateType #3

Closed creativecreatorormaybenot closed 4 years ago

creativecreatorormaybenot commented 4 years ago

I think that you are not corretly setting the updateType, which causes it to always be null.

https://github.com/feilfeilundfeil/flutter_in_app_update/blob/e6d0ad88b4a22be93cc71ecd1f9ba56b4a26bc1a/android/src/main/kotlin/de/ffuf/in_app_update/InAppUpdatePlugin.kt#L125

I would create a pull request that fixes this on the Dart side, i.e. change the properties to be immediateAllowed and flexibleAllowed as I think that it is better to work with than checking updateType for null.
If I am missing something, please tell me.

jonasbark commented 4 years ago

True, thanks for spotting it!

creativecreatorormaybenot commented 4 years ago

@jonasbark I will create the PR in a second. I also did some refactoring, however, I can obviously adjust it.