IapExample: Products.tsx vs ClassSetup.tsx #2791
Unanswered
PatriciaSauer
asked this question in
Q&A
Replies: 1 comment
-
I believe the dependency of currentPurchase in the use effect is just an alternative way to respond to the purchase update listener when using hooks. It's not clear to me either whether it's best to use hooks or follow the guidance in the docs about avoiding async await |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm still trying to understand how this library works. So I investigated the example app a lot.
I still don't understand why in Product.tsx
finishTransaction
is wrapped inif ((isIosStorekit2() && currentPurchase?.transactionId) || currentPurchase?.transactionReceipt)
(see here) whereas in ClassSetup.tsx we are not wrapping in such an if (see here).Is the one in Products.tsx for iOS and the other one for Android? Why do I need both implementations? What is the dependency on
currentPurchase
of theuseEffect
hook for? Can't I just implement everything in the purchaseUpdateListener?Unfortunately, I was not able to run the example app. Maybe someone is able to provide detailed steps to run this app.
Any help would be appreciated. Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions