Skip to main content
Question

Credential issues after purchase confirmation

  • February 9, 2023
  • 1 reply
  • 167 views

Forum|alt.badge.img+2

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

Forum|alt.badge.img+8
  • RevenueCat Staff
  • 509 replies
  • February 13, 2023

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings