timtraversy / new_version

Check if your user has the most recent version of your Flutter app.
BSD 3-Clause "New" or "Revised" License
125 stars 152 forks source link

store version is less and local version is greater #81

Closed Samkit02 closed 2 years ago

Samkit02 commented 2 years ago

i am also facing the same issue and due to that my app is not working and all me users are affected so i need an early early response to this issue please understand

i dont why it is not working

https://user-images.githubusercontent.com/45647688/147190676-b8db11bd-5690-45fe-83f2-e324707d302d.png

above is the ios simulator image where it is showing update to 1.3.8 from 1.3.9

https://user-images.githubusercontent.com/45647688/147190739-846e8d3b-8d72-4330-a8d9-d71ea1036226.png

above is the image where in appstore my version is 1.3.9

https://user-images.githubusercontent.com/45647688/147190868-0a9695f7-fd35-4ac6-8dbd-e060fd144720.png

above is the image for logs printed in xcode

this is the code

i have called this method in initstate

void _checkVersion() async {
    SharedPreferences _share = await SharedPreferences.getInstance();
    print('lang: ${_share.getString('lang')}');
    final newVersion = NewVersion(
      androidId: 'com.webpioneer.snjewellery',
      iOSId: 'com.webpioneer.snjewellery',
    );
    final status = await newVersion.getVersionStatus();
    if (status.localVersion != status.storeVersion) {
      newVersion.showUpdateDialog(
        context: context,
        versionStatus: status,
        dialogTitle: "UPDATE!!!",
        dismissButtonText: "Later",
        dialogText: "Please update the app from " + "${status.localVersion}" + " to " + "${status.storeVersion}",
        dismissAction: () {
          Navigator.pop(context);
        },
        updateButtonText: "Update",
      );
    }

    print("DEVICE : " + status.localVersion);
    print("STORE : " + status.storeVersion);
  }
timtraversy commented 2 years ago

Probably a duplicate of #54

Are you seeing this issue while testing or after publishing?

Samkit02 commented 2 years ago

both

timtraversy commented 2 years ago

So you've downloaded the store version of the app, and it is reporting that it needs to be updated? What is your app ID?

Samkit02 commented 2 years ago

So you've downloaded the store version of the app, and it is reporting that it needs to be updated? What is your app ID?

app id -> com.webpioneer.snjewellery

fahaddev7 commented 2 years ago

@timtraversy @Samkit02 any update on this particular issue guys is it solved or is it yet to be solved?

fahaddev7 commented 2 years ago

@Samkit02 are you facing this issue only on ios? or even in android too?

lsalez commented 2 years ago

@Samkit02 In your code you compare if the local version is diferent from remote version if (status.localVersion != status.storeVersion)

Of couse return TRUE because 1.3.9 is diferente that 1.3.8

You need to use: if (status.canUpdate)

zenkog commented 2 years ago

I also get a similar problem only on iOS. So the package fetches the TestFlight build version instead of the App Store published app version. How can the status.canUpdate compare the local version with the Published app version instead of the TestFlight version?

(side note: My TestFlight builds version is always higher than the published app version because of previous developer versioning mistakes. Now we cannot fix the versioning without jumping version.)

timtraversy commented 2 years ago

Please open unrelated issues in their own tickets.

Samkit02 commented 2 years ago

@Samkit02 In your code you compare if the local version is diferent from remote version if (status.localVersion != status.storeVersion)

Of couse return TRUE because 1.3.9 is diferente that 1.3.8

You need to use: if (status.canUpdate)

oh okay will try that

Samkit02 commented 2 years ago

@timtraversy i have a query if my ios app is available in multiple countries including USA, INDIA, UAE and other countries what should i write in the iOSAppStoreCountry ??

please suggest..

i want to add this plugin into my app that i am planning to publish it before or on 20th March 2022 and my app will be avaiable in every country and mostly in ARAB countries.

please reply as soon as possible.

timtraversy commented 2 years ago

Please open unrelated topics in their own issue, thanks. I'm going to close this.