react-native-iap icon indicating copy to clipboard operation
react-native-iap copied to clipboard

Error E_IAP_NOT_AVAILABLE And iOS 14: RNIap.getProducts()/RNIap.getSubscriptions Unknown Error thrown

Open praful1021 opened this issue 2 years ago • 9 comments

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().

praful1021 avatar Sep 02 '21 09:09 praful1021

I am experiencing the same issue in iOS real device Did you resolve it?

devuco avatar Sep 02 '21 09:09 devuco

any update on this matter?

kabus202 avatar Sep 03 '21 10:09 kabus202

Same here

fbotalla avatar Sep 04 '21 03:09 fbotalla

+1

dmitryusikriseapps avatar Sep 06 '21 09:09 dmitryusikriseapps

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.

dmitryusikriseapps avatar Sep 13 '21 19:09 dmitryusikriseapps

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.

stale[bot] avatar Apr 18 '22 18:04 stale[bot]

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 avatar Apr 26 '22 17:04 caoyongfeng0214

@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 avatar Jun 08 '22 08:06 catmans1

@catmans1 Does this mean we don't need to initConnection for iOS at all? I wish the docs mentioned that.

liquidvisual avatar Aug 05 '22 01:08 liquidvisual

@liquidvisual - did you find this was actually the case?

princefishthrower avatar Nov 03 '22 15:11 princefishthrower