Help with documentation and crash after purchrase
See original GitHub issueVersion of react-native-iap
0.2.16
I’m not an Android or IOs developer and I’m starting now with the purchase system. Among all libraries for react native yours seems the only one with cross platform support and subscription. Thanks for your amazing job.
My questions following:
-
Is there anything bad in checking the subscription status every time the app loads?
-
What’s the difference between “refreshAllItems” and “getSubscribeItems”? It seems (from the description) they do the same but in the description is unclear
-
What’s the difference between buyItem and buySubscriptionItem?
-
I’m currently testing by releasing alpha version, I tried in many ways to deploy with android a dev version but seems impossible (by design), there’s very little on react native, a guide would be amazing (but I understand you already have done a great job)
-
The app crash after purchase (the subscription is there after), I don’t see anything wrong and the catch should prevent the app from crashing (but I notice in a few scenario it doesn’t). I’m on Android
async subscribe() {
this.log("subscribe called")
try {
const isOS = Platform.OS === 'ios'
const subscriptionName = isOS ? 'com.cooni.monthly' : 'monthly'
this.log("attempting to subscribe")
const receipt = await RNIap.buyItem(subscriptionName)
this.log("receipt")
this.log(receipt)
} catch(e) {
this.log("bought")
this.log(e)
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (6 by maintainers)
so,
buySubscribeItem
fixed the crash, which is great, andfetchHistory
returns the receipt. I still don’t know what “refreshPurchaseItemsAndroid” is for, it’s after the user deleted and reinstalled the app?My bad, fetchHistory returns an empty array (I had the original receipt in state). That’s my updated code, the purchase works but
fetchHistory
returns an empty array. I’m not 100% sure I understand the meaning of “refreshing” products, but my understanding is that I should not call it. Thanks for your help