Question

Making a purchase on iOS Simulator with Storekit does not work if you log the user in using Purchases.logIn() on React Native

  • 10 February 2022
  • 2 replies
  • 153 views

Userlevel 1
Badge +8

Hi,

 

I have setup StoreKit on my React Native app so that I can test out making purchases for a `auto renew subscription` on a simulator. However when trying to purchase a subscription using `await Purchases.purchasePackage(product)` its was failing with the `UKNOWN ERROR`. I manage to get it working by removing the login call (i.e. await Purchases.logIn(userId)) which I was doing when a user logged into my app. However this is not an ideal solution as I want to correctly identify the user by logging them into RevenueCat.

 

Is this an issue with StoreKit and RevenueCat? Or am I doing something wrong?

 

Cheers,

Walter


2 replies

Userlevel 3
Badge +8

Hi @Walter Holohan,

Thanks for reaching out. Would you be able to share debug logs of this so I can look at the context of the error? You can enable debug logs by following this guide. After they're enabled you'll see logs like this in the console:

[Purchases] - DEBUG: No cached entitlements, fetching
[Purchases] - DEBUG: GET /v1/subscribers/<APP_USER_ID> 200
[Purchases] - DEBUG: Purchaser info updated, sending to delegate

Make sure the debug logs include the entire app life-cycle, including the messages printed during initialization of the SDK. (But feel free to scrub out any information you find sensitive)

Userlevel 1
Badge +8

@sundeep I sent a reply with the logs, however it said that the post needed to be reviewed first before publishing. Can you take a look please?

Reply