Question

Credential issues after purchase confirmation

  • 9 February 2023
  • 1 reply
  • 86 views

Badge +1

Hello. I'm able to list products and make purchases but after making a purchase I get this error.

I read on the documentation that if you get this error after purchasing I need to make sure the shared secret is correct. So I double checked but got the same result, then I regenerated another shared secret but I'm still getting the same error message:

There was a credentials issue. Check the underlying error for more details. Invalid API Key.

at node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:105:59 in promiseMethodWrapper

at node_modules/react-native-purchases/dist/purchases.js:401:74 in __generator$argument_1

at node_modules/react-native-purchases/dist/purchases.js:33:26 in step

at node_modules/react-native-purchases/dist/purchases.js:5:61 in fulfilled

 

If I try to restore my purchases I get the same error. 

Hopefully somebody can help me with this issue.

This is the code I'm using to restore:

const restore = async () => {
try {
await Purchases.restorePurchases();
const purchaserInfo = await Purchases.getCustomerInfo();
console.log(purchaserInfo)
setIsSubscribed(typeof customerInfo.entitlements.active[productIdentifier] !== "undefined");
} catch (error) {
console.error(error);
}
};

 

This is the code I'm using to purchase:

const purchase = async () => {
try {
const buy = await Purchases.purchaseProduct(productIdentifier)
const purchaserInfo = await Purchases.getCustomerInfo();
console.log('BUY: ',buy);
} catch (error) {
console.error(error);
}
};

Thanks


1 reply

Userlevel 4
Badge +8

This error you are getting is from an invalid API key, not the shared secret. Please check that your API key is entered correctly

Reply