react-native-iap
react-native-iap copied to clipboard
Getting blank array while calling getSubscriptions to get subscription list from app store.
Please use the Discussion board if you want to get some help. Please use issues to report bugs.
Description I am not getting Product list from getSubscription method before the licencing update it was working fine after the update i am not able to get the subscription from the below method.
const products = await getSubscriptions({skus: itemSkus});
I have tried upgrading/degrading the library still not get any luck
Expected Behavior while calling the getSubscriptions it will return my created Subscription on app store. but getting blank array. all my subscription are active in app store.
Environment:
- "react": "17.0.2",
- "react-native": "0.68.2",
- react-native-iap: "^12.10.5",
- react-native:
- Platforms (iOS, Android, emulator, simulator, device): iOS device
I'm having the same issue on android, any solutions..?
Any solutions? Guys. My app is on closed testing and i still get empty array for fetching subscription on real device.
Hi @dorjsurend @coofzilla its due to policy and agreement acceptance. please check your app/play store is there any thing is left to accept. in my case i am facing this issue due to agreement acceptance for iOS. and for android i didn't get any issue.
Hi @dorjsurend @coofzilla its due to policy and agreement acceptance. please check your app/play store is there any thing is left to accept. in my case i am facing this issue due to agreement acceptance for iOS. and for android i didn't get any issue.
In my case it was because I didn't have my offerToken
on the android side. 🤦🏽♂️
Hi @coofzilla use this below code
const handleBuySubscription = async (productId, offerToken) => {
try {
await requestSubscription({
sku: productId,
...(offerToken && {
subscriptionOffers: [{sku: productId, offerToken}],
}),
}).then(async res => {
// Here you will get the products.
console.log('object', res);
})
.catch(e => {
console.log('e ', e);
});
};
you can get the token from below subscription key:
subscription.subscriptionOfferDetails[0].offerToken,
@praveen-eci thanks, Is it possible to fetch subscriptions in debug mode?. I think only testing needs release build.
This is not an issue. You need to add a bank account and fill tax forms (or all requirements) to activate In-App purchases in Apple Dev Console. Otherwise, you will get an empty array.