4.4.4
The issue is reproduced on v 4.4.4 only, the 4.3.0 works like a charm
0.61.5
iOS
getPurchaseHistory() and getAvailablePurchases() return purchases
getPurchaseHistory() and getAvailablePurchases() aren't resolved or rejected
Simulator (13.4), iPhone 8 Plus (13.4), iPhone X (13.4)
Please see the code below:
const canMakePayments = await RNIap.initConnection()
if (!canMakePayments) {
dispatch(setAvailableIapProductsSuccess(null))
return
}
const products = await RNIap.getProducts(R.consts.IAP_SKUS)
logger.log('Available IAP: ' + JSON.stringify(products))
dispatch(setAvailableIapProductsSuccess(products))
try {
const pendingPurchases = await RNIap.get()
logger.log('Pending = ', JSON.stringify(pendingPurchases)) // => works fine
const availablePurchases = await RNIap.getAvailablePurchases() // => doesn't work
logger.log('Available purchases = ' + availablePurchases)
// the app never reaches here
const purchaseHistory = await RNIap.getPurchaseHistory() // => doesn't work
logger.log('Purchase history = ' + purchaseHistory)
} catch (err) {
logger.log(err)
}
Does anybody know how to fix that? I checked out the native code, as well as the bridge and all that seems fine.
Have been experiencing the same issue since last night. +1
Looks related to #982. Could you try 4.4.6 and comeback?
Looks resolved now.
@hyochan 4.4.6 works perfectly, thanks a lot
This isn't working for me either in version 4.5.2 (on dev and test-flight). This never returns anything:
RNIap.getPurchaseHistory().then((history) => {
updateLog(history, 'history')
}).catch((ex)=> {
updateLog(ex, 'history_fail');
});
RNIap.getAvailablePurchases().then((history) => {
updateLog(history, 'available')
}).catch((ex)=> {
updateLog(ex, 'available_fail');
});
For me it's working after I read this issue... I just update for (version 4.5.3). Perfect. 馃憣
4.5.3 not working for me either.
@dioptre did you resolved this already ? if yes can you please share the steps.
incase anybody still facing this issue please don't forget to initialize connection in component did mount and its safe to end connection when unmount, here are the methods from docs:
RNIap.initConnection();
RNIap.endConnection();
Hey body!
I change for another library. Now I am using RevenueCat.
I am on 5.0.1 and see this issue as well. RNIap.getPurchaseHistory() and getAvailablePurchases() both never resolve nor reject. Any fix out there?
On 5.1.3, It works with initConnection and endConnection
Most helpful comment
@hyochan 4.4.6 works perfectly, thanks a lot