react-native-iap
react-native-iap copied to clipboard
Error E_IAP_NOT_AVAILABLE And iOS 14: RNIap.getProducts()/RNIap.getSubscriptions Unknown Error thrown
Please use Discussion board if you want get some help out of it. Please report issue if there is a bug.
Version of react-native-iap
7.3.0
Version of react-native
0.61.4
Platforms you faced the error (IOS or Android or both?)
iOS
Expected behavior
products/subscription to be fetched.
Actual behavior
unknown error being returned error thrown: E_IAP_NOT_AVAILABLE
Tested environment (Emulator? Real Device?)
Real Device/ iOS Simulator
Steps to reproduce the behavior
Just call RNIap.getProducts() or RNIap.getSubscriptions().
I am experiencing the same issue in iOS real device Did you resolve it?
any update on this matter?
Same here
+1
I've found the reason. I called methods for the android platform without a condition Platform.OS === 'android'
. It produces an error now if it's called for the different platforms.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.
same here. iOS 15
RNIap.initConnection().then(() => {
}).catch(ex => {
alert(ex.message); // catched exception: E_IAP_NOT_AVAILABLE
})
Is there some configuration or prerequisites required?
@caoyongfeng0214
Because of this
/**
* Init module for purchase flow. Required on Android. In ios it will check wheter user canMakePayment.
* @returns {Promise<boolean>}
*/
export declare const initConnection: () => Promise<boolean>;
on iOS don't need implement it.
We can change the code a bit
if (Platform.OS === 'android') {
RNIap.initConnection().then(() => {
}).catch(ex => {
alert(ex.message); // catched exception: E_IAP_NOT_AVAILABLE
})
}
@catmans1 Does this mean we don't need to initConnection for iOS at all? I wish the docs mentioned that.
@liquidvisual - did you find this was actually the case?