Skip to main content
Question

when purchaseStoreProduct, no response


Forum|alt.badge.img+1

I am trying to purchase a product in React native.

my env:

"react-native": "0.68.2",

"react-native-purchases": "^6.6.5",

 

in iOS, after configure with iOS public key, I try to purchase a product by using a function purchaseStoreProduct

const { customerInfo, productIdentifier } = await Purchases.purchaseStoreProduct(product);

But I could not get any response as well as any errors.

In my test, I could get the Apple login modal prompt at the first function call.
But after some times, when trying to call this function, I could not get any response.

 

This post has been closed for comments

4 replies

cody
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • 501 replies
  • October 12, 2023

Hey @cheng-he-70a75c,

Apologies, I’m not sure we have enough information to investigate what’s happening in this case.

Can you provide debug logs reproducing the issue?


Forum|alt.badge.img+1

Thanks for reaching me.

After following the sandbox test in iOS, (especially using StoreKit), then it worked.

Best.


Forum|alt.badge.img+3
  • New Member
  • 4 replies
  • March 9, 2024

I’m having the same issue here. Using Expo w. React Native.

When calling: `const result = await Purchases.purchaseStoreProduct(product)` Promise neither rejects nor resolves and thus subsequent statements are not executed.

This happens on physical iOS device. Haven’t tested on Android just yet.


Forum|alt.badge.img+3
  • New Member
  • 4 replies
  • March 11, 2024

Actually, I fixed my issue. I was mistakenly calling Purchases.configure mutliple times as the call was located in a custom hook.

I moved Purchases.configure outside my component tree into the root file and instead called Purchases.logIn inside my custom hook to add the appUserId.

Works as expected now 👍


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