react-native-purchases icon indicating copy to clipboard operation
react-native-purchases copied to clipboard

Purchases.getEntitlements() not resolving on android

Open kirkness opened this issue 8 years ago • 7 comments

Steps to reproduce:

  • react-native init TestApp
  • cd TestApp
  • yarn add react-native-purchases
  • react-native link react-native-purchases
  • Add the following to App.js:
async componentDidMount() {
  console.log(1);
  await Purchases.setup(REVENUE_CAT_KEY, '123');
  console.log(2);
  await Purchases.getEntitlements();
  console.log(3);
}
  • react-native run-android

Logs 1 and 2, but no 3 😕

kirkness avatar Sep 18 '18 12:09 kirkness

This is caused by the lack of Google Play Services as well yea?

jeiting avatar Sep 27 '18 15:09 jeiting

No this one isn't, but could be something to do with the Play Store setup. I'll update this issue when it's confirmed.

kirkness avatar Sep 28 '18 08:09 kirkness

Looks like this could not be to do with the play store setup. Do you have any way of validating this? Working on iOS, Google Play services are installed, running on an emulator, no response/resolve from getEntitlements.

kirkness avatar Sep 28 '18 16:09 kirkness

Hey @jeiting, just looking into this again - im still not seeing it resolve/reject. Ive had a look in RNPurchasesModule.java and neither onReceiveEntitlements or onReceiveEntitlementsError are being called.

kirkness avatar Oct 01 '18 16:10 kirkness

For anyone else with this issue, it was because I wasn't signed into a Play Account on the device I was testing on.

kirkness avatar Oct 01 '18 19:10 kirkness

@vegaro I just experienced this as well. Since entitlements is not returning, the user experiences an infinite loading icon.

I want to communicate with the user that they are not signed into play services instead of showing an infinite loader. How do I do that?

KevinColemanInc avatar Mar 15 '19 14:03 KevinColemanInc

@KevinColemanInc there's no easy way of doing this right now, but we are planning on supporting it. There is already an approved PR https://github.com/RevenueCat/purchases-android/pull/58 in Android that we should be shipping soon. These new methods will let you check for billing support before trying to load anything.

vegaro avatar Mar 15 '19 16:03 vegaro