Question

[TypeError: Cannot read property 'identifier' of undefined]

  • 23 April 2024
  • 1 reply
  • 20 views

Badge

I am setting up a one-time purchase with Revenuecat

I have set up subscriptions before, but never a one-time purchase like the “coins” I am attempting to sell now. 

 

I am logging “currentOffering?.availablePackages and see the correct product I want to sell. When I run:

 

const { customerInfo } = await Purchases.purchasePackage(currentOffering?.availablePackages?.coins);

 

I get this error: 

 

[TypeError: Cannot read property 'identifier' of undefined]

 

Please let me know if you can see what I am doing wrong. Please see the attached screenshot to see what is logging out for my currentOfferings


This post has been closed for comments

1 reply

Userlevel 4
Badge +8

Hi, can you make sure you are passing a package to the purchasePackage method? https://revenuecat.github.io/react-native-purchases-docs/7.26.3/classes/default.html#purchasePackage

Additionally, could you please provide the entire debug logs for this? You can enable them here: https://www.revenuecat.com/docs/test-and-launch/debugging#section-debugging