kumparan / react-native-android-inapp-updates

React Native implementation of the Android In-App Update API.
101 stars 15 forks source link

No Update available #8

Closed afkcodes closed 3 years ago

afkcodes commented 3 years ago

Hello I have used this pacakage but it seems it only says no update available though when i see in playstore the update is available. Anything that i am missing or doing wrong ? Any help would be appeciated.

Desintegrator commented 3 years ago

same issue Have you solved it?

gedeagas commented 3 years ago

@afkcodes @Desintegrator hey what kind of problem do you have?

Refer here for in app update testing https://developer.android.com/guide/playcore/in-app-updates/test

You will need to test the app via Internal App Sharing Use internal app sharing to test in-app updates by performing the following steps:

  1. Make sure your test device has a version of your app installed that supports in-app updates and was installed using an internal app sharing URL.
  2. Follow the Play Console instructions to share your app internally. Upload a version of your app that uses a version code that is higher than the one you already have installed on the test device.
  3. On the test device, click the internal app sharing link for the updated version of your app but do not install the app from the Play Store page that appears after you click the link.
  4. Open the app from the device's app drawer or home screen. The update should now be available to your app, and you can test your implementation of in-app updates.
shubhamdeol commented 3 years ago

any update on this? Does not seem to work for me as well. I can see update available on playstore. but my app does not show app prompt

gedeagas commented 3 years ago

@shubhamdeol are you testing it via the internal app sharing? it will not work if you are not using that. and make sure the internal app sharing version of app is lower than the current production version

shubhamdeol commented 3 years ago

@gedeagas Yes. I am testing via internal app sharing

Your second point. make sure the internal app sharing version of app is lower than the current production version

Its not possible to have app version lower in internal release channel than production channel. Playstore does not let user update app with lower version name.

gedeagas commented 3 years ago

Its not possible to have app version lower in internal release channel than production channel. Playstore does not let user update app with lower version name.

Please use Internal App Sharing not internal release channel. You can acess those from here https://play.google.com/console/u/0/internal-app-sharing/.

The apk that you upload via Internal App Sharing will not be published to the Internal Track on Google Play Store. Internal app sharing lets you quickly share app bundles and APKs with your internal team using a link. With Internal app sharing Your version codes don't need to be unique, and you can even upload debuggable artifacts

gedeagas commented 3 years ago

You can read more about this on https://play.google.com/console/about/internalappsharing/

shubhamdeol commented 3 years ago

@gedeagas Thanks a lot. This does make sense to me now. I will try this out.

gedeagas commented 3 years ago

@gedeagas Thanks a lot. This does make sense to me now. I will try this out.

Sure, glad to be of help.

shubhamdeol commented 3 years ago

@gedeagas I tried on internal app sharing getting error No update available. Do I need to install google play core separately?

shubhamdeol commented 3 years ago

here is how I am using this

const eventEmitter = new NativeEventEmitter(NativeModules.AndroidInappUpdates);

eventEmitter.addListener('installStatus', (event: number) => {
  //11 is downloaded status
  if (event === 11) {
    alert('app updated successfully');
    onCompleteUpdate();
  }
});

const checkForUpdate = async () => {
  try {
    const checkUpdateResult = await checkUpdateAvailability();
    alert('first' + checkUpdateResult);
    if (checkUpdateResult === 'Update available') {
      const updateFlowResult = await startUpdateFlow('flexible');
      alert(JSON.stringify(updateFlowResult));
    }
  } catch (error) {
    alert(JSON.stringify(error));
  }
};

Inside useEffect

React.useEffect(() => {
    const timeout = setTimeout(() => {
      checkForUpdate();
    }, 5000);
    return () => {
      clearTimeout(timeout);
    };
  }, []);

I also added

    implementation 'com.google.android.play:core:1.7.3' 

inside app/build.gradle

shubhamdeol commented 3 years ago

Also, Do I need to increase version name too along with version code for second build ?

black-nijar commented 3 years ago

Also, Do I need to increase version name too along with version code for second build ?

HI @shubhamdeol ,am also facing this issue. please let me know the procedure if it's working fine Thanks in advance

shubhamdeol commented 3 years ago

@black-nijar I had to switch to another library. sp-react-native-in-app-updates