Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android versionCheck.needUpdate() returns undefined #177

Open
MichaelAmadheo opened this issue Aug 15, 2022 · 5 comments
Open

Android versionCheck.needUpdate() returns undefined #177

MichaelAmadheo opened this issue Aug 15, 2022 · 5 comments

Comments

@MichaelAmadheo
Copy link

This is working on iOS but not working for android, it returns undefined

@lundjrl
Copy link

lundjrl commented Aug 26, 2022

@MichaelAmadheo Same here but our app is currently in development and does not have an app store presence on either platform. Is this the same for you?

@lapwil
Copy link

lapwil commented Aug 29, 2022

yep same for me, but only on development env. everything works on staging and release.

@MichaelAmadheo
Copy link
Author

@lundjrl we have the app presence both on Playstore and Appstore. It used to return all the information just like iOS, but just recently it returns undefined and we cannot get the url for playstore

@adelchms96
Copy link

@MichaelAmadheo i solved this by using VersionCheck.getStoreUrl() for android and versionCheck.needUpdate() for ios for now !

@NageshA
Copy link

NageshA commented Sep 16, 2022

@MichaelAmadheo use the below code. In Android I used was able to solve it by this code latestVersion we need to pass to .needUpdate function.

const res = await fetch(
        `https://play.google.com/store/apps/details?id=${VersionCheck.getPackageName()}&hl=en`,
      );
      const text = await res.text();
      let latestVersion;
      const match = text.match(/\[\[\["([\d.]+?)"\]\]/);
      if (match) {
        latestVersion = match[1].trim();
      }
      
      let updateNeeded = await VersionCheck.needUpdate({
        latestVersion,
      });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants