Discussions

Ask a Question
Back to All

React-native android makePurchase returns purchaserInfo as undefined in sandbox mode

Good day.

I am using rn v6.2.0

When in sandbox mode I try to buy a product, transaction goes fine, i receive an email from google and i can get receipt id. But purchaserInfo returns as undefined.

I tries to find anything in docs about it, but found nothing.

My code looks like this:

try {
const {purchaserInfo, receipt, product} =
await adapty.purchases.makePurchase(productt);
console.log('\x1b[36m%s\x1b[0m', purchaserInfo, receipt, product);
// "premium" is an identifier of default access level
if (purchaserInfo?.accessLevels['premium'].isActive) {

  }
} catch (e) {}

I am trying to get this information:
transaction id and purchase id

When I try to restore purchases, with

const {purchaserInfo, receipt, googleValidationResults} =
await adapty.purchases.restore();

I get
purchaserInfo with empty accessLevels, empty nonSubscriptions and a profileId
receipt undeifned
googleValidationResults undefined

What am i doing wrong?