dooboolab-community / react-native-iap

In App Purchase module for React Native!
https://react-native-iap.dooboolab.com
MIT License
2.74k stars 633 forks source link

getSubscriptions returns empty array on IOS (everything working fine on Android) #2208

Open chrisdev0342 opened 1 year ago

chrisdev0342 commented 1 year ago

Description I am fetching renewable subscriptions in IOS, which always returns an empty array. Although everything is working fine on Android. I also tried to run requestSubscription with one of the sku but it throws an error:

E_DEVELOPER_ERROR Invalid product ID

I am trying to fetch like: const subscription = await RNIap.getSubscriptions({ skus: ["subscription_01", "subscription_01"] });

I've been struggling with this from past week, I have tried to push build to TestFlight and test but no success. Any help will be much appreciated.

Expected Behavior Ideally it should return an array of subscriptions just like Android.

Environment:

andresesfm commented 1 year ago

Is this on a device with iOS 15 or newer? have you tried using Storekit2 mode?

chrisdev0342 commented 1 year ago

Is this on a device with iOS 15 or newer? have you tried using Storekit2 mode?

Yes, using StoreKit it works in debug mode but after deploying on TestFlight does not work.

andresesfm commented 1 year ago

I have seen this on other tickets. It might be the kind of subscription. For iOS 15+, using storekit2 mode seems to solve it.

pierroo commented 1 year ago

Any update on this? Is it confirmed that we need storekit2 mode for ios 15+? I thought storekit2 wasn't mandatory?

andresesfm commented 1 year ago

This could be a configuration issue on the appstore,

5ylvino commented 1 year ago

I am currently facing the same issue with subscriptions fetching an empty array. But let me try the Storekit2 mode and see how it goes.

5ylvino commented 1 year ago

Wow! I woke up this morning, I did the Storekit configuration. And everything started working perfectly as supposed. Though, I ensured that everything matched the values I have on the apple console.

Thanks

oloyedewaris commented 1 year ago

I've been facing this same issue of fetching empty array for about 2 weeks now

Please how do I use storekit2?

5ylvino commented 1 year ago

@oloyedewaris follow the step in this documentation ===> https://www.revenuecat.com/blog/engineering/ios-in-app-subscription-tutorial-with-storekit-2-and-swift/#h-setting-up-app-store-connect

itsdenispavlovic commented 9 months ago

I am getting the same error, but on purchase. I am using expo 49

sanjaysoalnki2000 commented 6 months ago

Is this on a device with iOS 15 or newer? have you tried using Storekit2 mode?

Yes, using StoreKit it works in debug mode but after deploying on TestFlight does not work.

i facing same problem.

also using setup({storekitMode:'STOREKIT2_MODE'})

inayatAliDev commented 1 month ago

I am also getting same issue

all steps done (storekit confiuguration) as described here: https://developer.apple.com/documentation/xcode/setting-up-storekit-testing-in-xcode#Enable-StoreKit-Testing-in-Xcode

but now getting empty array when try to fetch subscritions

anwargul0x commented 1 week ago

any updates on this issue?