I followed the docs on https://www.revenuecat.com/docs/making-purchases but I'm experiencing a strange issue.
Here's my code:
const offerings = await Purchases.getOfferings();
const result = offerings.current.availablePackages[0];
const { customerInfo } = await Purchases.purchasePackage(result);
console.log('After purchase:', customerInfo);
if (typeof customerInfo.entitlements.active.premium !== 'undefined') {
// Successful purchase code.
}
The payment goes through but Purchases.purchasePackage() never returns so the code afterwards isn't executed.
I added an event handler to listen for customer info updates and it works fine but using it instead of the code above complicates things in my server implementation.
Purchases.addCustomerInfoUpdateListener((info) => {
console.log('Customer info update:', info)
});
Any suggestions on how to make it work?
Edit: I'm using a real Android device and my app is on the internal testing google play track. Purchases are in test-mode with a test card.
I followed the docs on https://www.revenuecat.com/docs/making-purchases but I'm experiencing a strange issue.
Here's my code:
The payment goes through but
Purchases.purchasePackage()never returns so the code afterwards isn't executed.I added an event handler to listen for customer info updates and it works fine but using it instead of the code above complicates things in my server implementation.
Any suggestions on how to make it work?
Edit: I'm using a real Android device and my app is on the internal testing google play track. Purchases are in test-mode with a test card.