kimxogus / react-native-version-check

A version checker for react-native applications
MIT License
713 stars 171 forks source link

can't read play store version info in Android #93

Closed JongGyuChoi closed 4 years ago

JongGyuChoi commented 4 years ago

message: 'Parse Error. Your app\'s play store page doesn\'t seem to have latest app version info.',

is this bug??

kimxogus commented 4 years ago

It's not a bug. This library parse html of play store webpage and extract app version from that. If the page doesn't contain app version, it will throw that error.

smdjeff commented 4 years ago

works fine. close this.

manuhook commented 4 years ago

I'm having the same warning, Maybe the structure of the playstore page have changed ?

ssuchanowski commented 4 years ago

Aren't the versions permanently removed from google play pages? Seems like there should be a different/fallback solution for this.

mateusschenato commented 4 years ago

I'm having the same issue, any solution ?

kimxogus commented 4 years ago

As long as play store doesn't provide app version, you need to use custom provider using your own api providing latest app version.

It seems may app pages in play store doesn't provide app version :( Is there any api that provides play store app version?

manuhook commented 4 years ago

On my side, I don't have any app version because I'm using 2 app bundles/apk with different version.

lorebook commented 4 years ago

Check Your play store app name and your react native app name

because react-native-version-check search your app name in play store and app store

JosManMx commented 4 years ago

Hi, I had this issue too, check your react-native-version-check version, I had 3.2.1 and the latest is 3.4.1 when I update fix to me.

Otherwise, if this don't resolve the issue, you can pass a custom provider for android:

export const getAndroidLatestVersion = () => fetch(
  `https://play.google.com/store/apps/details?id=${
    VersionCheck.getPackageName()
  }&hl=en`,
)
  .then(res => res.text())
  .then((text) => {
    const match = text.match(/Current Version.+>([\d.]{4,10})<\/span>/);
    if (match) {
      const latestVersion = match[1].trim();
      return Promise.resolve(latestVersion);
    }
    return Promise.reject();
  });
Anujmoglix commented 4 years ago

I am also facing this issue . version is 3.4.1

rf1804 commented 4 years ago

With the latest version of react-native and react-native-version-check with auto linking (For ios pods required). It works perfectly fine for android as well as ios.

ssuchanowski commented 4 years ago

It works on Android? You mention iOS for some reason.

rf1804 commented 4 years ago

@ssuchanowski comment updated

It works on Android? You mention iOS for some reason.

With the latest version of react-native and react-native-version-check with auto linking (For ios pods required). It works perfectly fine for android as well as ios.

Doenja commented 3 years ago

Check Your play store app name and your react native app name

because react-native-version-check search your app name in play store and app store

For me this was the issue. If you open your android/app/build.gradle you can check whether the applicationId is the same as the applicationId in the Google Play Console. If the names don't match update your applicationId in build.gradle.

eamanola commented 2 years ago

3.4.2 facing this issue

Tony0205 commented 2 years ago

3.4.2 facing this issue too :(

StevenChen0824 commented 2 years ago

same here on v3.4.2, is it because google change the format of html? use to have something like current version key word? but now I can't find it. The version code is now wrapped inside array.

crosswin-ecgroup commented 2 years ago

@StevenChen0824 @Tony0205 @eamanola @Anujmoglix @mateusschenato @JongGyuChoi , I fixed this issue, by passing the package Name,

await VersionCheck.needUpdate({ packageName: 'YOUR_ANDROID_PACKAGE_NAME(com.xxx.xxxx)', });

Like this,

Hope this will fix this issue.

ancyrweb commented 2 years ago

Check that your app hasn't been removed by Google during the review

EHRdev commented 2 years ago

Same problem, I think that the scraper HTML can no longer fetch the version because PlayStore doesn't show it (check in the source code of a published app).

Yoy can do as a temporary solution is to manually add the version (example '1.0' ... '2.0', ... etc.) in the "Version Notes - Google Play Console", this will make the HTML provided by PlayStore carry the explicit version.

As I say it is a temporary solution.

Joan0018 commented 2 years ago

@EHRdev hi, may I know do you found any solution to fix this? I face the same issue

viniciussgp commented 2 years ago

Any solution to fix this issue?

sumit-anar commented 2 years ago

May I know, by when can we expect a solution for this problem?

sumit-anar commented 2 years ago

There is a PR raised with the fix, https://github.com/kimxogus/react-native-version-check/pull/166/files. Can you guys please approve and release this on priority?

mahdieh-dev commented 2 years ago

There is a PR raised with the fix, https://github.com/kimxogus/react-native-version-check/pull/166/files. Can you guys please approve and release this on priority?

This PR works fine, thank you greatly @sumit-anar
@kimxogus could you merge this PR, please?

Parth8733 commented 2 years ago

This PR works fine for me as well. @JongGyuChoi, Could you please approve and merge this PR asap?

There is a PR raised with the fix, https://github.com/kimxogus/react-native-version-check/pull/166/files. Can you guys please approve and release this on priority?

stefanleoussis commented 2 years ago

This PR works fine for me as well. @JongGyuChoi, Could you please approve and merge this PR asap?

There is a PR raised with the fix, https://github.com/kimxogus/react-native-version-check/pull/166/files. Can you guys please approve and release this on priority?

Yes I need this aswell

viniciussgp commented 2 years ago

@stefanleoussis Could you please approve and merge this PR? To close this issue..

stefanleoussis commented 2 years ago

@stefanleoussis Could you please approve and merge this PR? To close this issue.

I don't believe I have the ability to unfortunately, I can only approve it @viniciussgp

3NM79 commented 2 years ago

Any updates on this?

3NM79 commented 2 years ago

This PR fixes the issue: https://github.com/kimxogus/react-native-version-check/pull/166/files

Until this is merged you can use the following solution for Android:

 const res = await fetch(
    `https://play.google.com/store/apps/details?id=${VersionCheck.getPackageName()}&hl=en`
  );
  const text = await res.text();

  const match = text.match(/\[\[\["([\d.]+?)"\]\]/);
  if (match) {
    const latestVersion = match[1].trim();
    return latestVersion;
  } else return null;

This successfully extracts the version number from your app page. You can now compare the latest version number with the current one and implement your custom logic.

wenge8n commented 2 years ago

The master branch code is updated but new tag 3.4.3 is not released.

Temporary workaround

yarn add 'https://gitpkg.now.sh/kimxogus/react-native-version-check/packages/react-native-version-check?master' or npm install 'https://gitpkg.now.sh/kimxogus/react-native-version-check/packages/react-native-version-check?master'

renatoAraujoSantos commented 2 years ago

patch available version 3.4.3 https://www.npmjs.com/package/react-native-version-check?activeTab=versions