Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Am getting error : The sku was not found. Please fetch products first by calling getItems #566

Closed
binil1931 opened this issue Jun 25, 2019 · 6 comments
Labels
🤖 android Related to android 🙏 help wanted Extra attention is needed

Comments

@binil1931
Copy link

3.0.0 of react-native-iap

0.57.8 of react-native

Platforms you faced the error (IOS or Android or both?)

Expected behavior

After successful subscribe get the receipt

Actual behavior

Subscription getting error
"The sku was not found. Please fetch products first by calling getItems"

Tested environment (Real Device)

Steps to reproduce the behavior

const itemSkus = Platform.select({
ios: [
''
],
android: [
'sub_1'
]
});

Step 1:
async componentDidMount() {
const msg = await RNIap.initConnection();
const items = await RNIap.getProducts(itemSkus);
RNIap.getProducts(items).then((products) => {
}).catch((error) => {
console.log("inApp getProducts error ",error.message);
})
}

Step 2: Call subscribe
_subscribe(){

  RNIap.buySubscription('sub_1').then(purchase => {
    console.log("inApp Subscription transactionReceipt ",purchase.transactionReceipt);
   }).catch((error) => {
    console.log("inApp Subscription error",error.message);
   })
}

it throws error "The sku was not found. Please fetch products first by calling getItems"

@carlosqsilva
Copy link

Same here

@hyochan
Copy link
Member

hyochan commented Jun 26, 2019

You are buying subscription but using getProducts. Try using getSubscription instead.

@hyochan hyochan closed this as completed Jun 26, 2019
@hyochan hyochan added 🙏 help wanted Extra attention is needed 🤖 android Related to android labels Jun 26, 2019
@chetan-plrch
Copy link

chetan-plrch commented Feb 4, 2020

I am facing the same problem even when I use getSubscriptions. Why is there a issue with this as well. Any idea ? @hyochan

And if there is a complete implementation available for this package (especially for apple in-app) that you might have come across, can you provide a link for that.

@amitkamble60
Copy link

await RNIap.initConnection();
const products = await RNIap.getSubscriptions(itemSkus);
const subs = await RNIap.getAvailablePurchases();

i use the above code its working fine.
but when i go to subscribe item its shows error that item not available. check below code for subscribe item

RNIap.requestSubscription(itemSkus[0]).then((result) => {
console.log('result request', result);
}).catch((e) => {
console.log('error request', e);
});

i also cross verified the itemSkus i am using

@Benzer1406
Copy link

Benzer1406 commented Nov 30, 2020

Facing the same issue with getSubscriptions but only on Android. Seems as if the function does not get invoked sometimes.

@Madhavan86
Copy link

Me too facing the same issue in android. Am getting 'The sku was not found. Please fetch products first by calling getItems'.
Can someone help me what is the problem in Android.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 android Related to android 🙏 help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants