Open MichaelAmadheo opened 2 years ago
@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?
yep same for me, but only on development env. everything works on staging and release.
@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
@MichaelAmadheo i solved this by using VersionCheck.getStoreUrl()
for android and versionCheck.needUpdate()
for ios for now !
@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,
});
This is working on iOS but not working for android, it returns undefined