Question

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

  • 23 April 2024
  • 2 replies
  • 44 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


2 replies

Userlevel 4
Badge +8

Hi @jacksoRoss apologies, it looks like the post closed out before you could respond. Are you still having problems with this? If so please let me know the information requested in the previous 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

Reply