Purchases.getEntitlements() not resolving on android
Steps to reproduce:
react-native init TestAppcd TestAppyarn add react-native-purchasesreact-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 😕
This is caused by the lack of Google Play Services as well yea?
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.
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.
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.
For anyone else with this issue, it was because I wasn't signed into a Play Account on the device I was testing on.
@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 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.