larryaasen / upgrader

A Flutter package for prompting users to upgrade when there is a newer version of the app in the store.
MIT License
547 stars 268 forks source link

Added an optional bundleId property to the Upgrader class. if present… #253

Closed proxy2501 closed 1 year ago

proxy2501 commented 1 year ago

Added an optional bundleId property to the Upgrader class. if present, this will override which Bundle ID is used to query the iTunes stores.

This addresses issue #250

codecov[bot] commented 1 year ago

Codecov Report

Base: 92.87% // Head: 92.88% // Increases project coverage by +0.00% :tada:

Coverage data is based on head (c61da5e) compared to base (5168152). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #253 +/- ## ======================================= Coverage 92.87% 92.88% ======================================= Files 10 10 Lines 969 970 +1 ======================================= + Hits 900 901 +1 Misses 69 69 ``` | [Impacted Files](https://codecov.io/gh/larryaasen/upgrader/pull/253?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Larry+Aasen) | Coverage Δ | | |---|---|---| | [lib/src/upgrader.dart](https://codecov.io/gh/larryaasen/upgrader/pull/253?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Larry+Aasen#diff-bGliL3NyYy91cGdyYWRlci5kYXJ0) | `90.21% <100.00%> (+0.03%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Larry+Aasen). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Larry+Aasen)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

larryaasen commented 1 year ago

I see that this would work, but why is it needed? Also, it should include unit tests.

famaranon commented 1 year ago

I see that this would work, but why is it needed? Also, it should include unit tests.

In case your app have multiple bundle ids for different environments.

larryaasen commented 1 year ago

I see that this would work, but why is it needed? Also, it should include unit tests.

In case your app have multiple bundle ids for different environments.

When the bundle IDs do not match, downloading and installing the update would not update the correct app on the device. This would be misleading to the user.

For example, if the App Store contained the app: com.foo.bar1, and the Upgrader package was built into the app com.foo.bar2, and Upgrader was told to look for com.foo.bar1 using this newly proposed optional bundleId parameter, it may find an update to com.foo.bar1, and ask the user to install it. After installing the app com.foo.bar1, the user would now have two apps on their device, and Upgrader would continue prompting the user to upgrader while running the app com.foo.bar2. That would be very confusing to the user.

proxy2501 commented 1 year ago

I am still unsure if this addition is needed at all, but we have had issues getting a good response from the iTunes store when using the Upgrader in a project wherein the package id and bundle id are different.

I have asked about this in #250, and speculated that the Upgrader makes the iTunes query using the incorrect bundle identifier, but have been unable to ascertain that this is really what's going on.

However, forking the code and making this change allowed us to manually set the bundleId being queried, which fixed the issue for us.