question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IOs can purchase only if i invoke getSubscriptions first

See original GitHub issue

Version of react-native-iap

2.2.2

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

IOS

Expected behavior

Should purchase the subscription

Actual behavior

I can only purchase if i invoke getSubscriptions first, otherwise, i get Invalid Product ID

Tested environment (Emulator? Real Device?)

Real device

Steps to reproduce the behavior

This works:

await RNIap.initConnection();
let subs =await RNIap.getSubscriptions(itemSkus);
console.warn(subs);
let purchase = await RNIap.buySubscription("someone");

This doesnt (throws invalid product id):

await RNIap.initConnection();
let purchase = await RNIap.buySubscription("someone");

On android works fine both

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
JJMooncommented, Oct 9, 2018

In iOS, initConnection doesn’t do anything. You should get subscription / production first. I think it’s the right response.

1reaction
hyochancommented, Oct 10, 2018

I’ve added Q & A section in readme. Will close this for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage App Store purchases, subscriptions, settings, and ...
Manage App Store purchases, subscriptions, settings, and restrictions on iPhone. In the App Store app , you can manage subscriptions and review and...
Read more >
React Native Android In App Purchase Error - Stack Overflow
On android Only - you need to open a connection to the billing service. This used to be RNIAP.prepare() , but it is...
Read more >
react-native-iap - npm
In iOS, it will simply call canMakePayments method and return value. ... Buy a product without finish transaction call (iOS only).
Read more >
API Reference | YouTube Data API - Google Developers
Note that a channel's sections are only visible if the channel ... code can be used as the value of the hl parameter...
Read more >
Client SDK Reference - OneSignal Documentation
The removeExternalUserId method will not work unless the external_user_id is set first with the setExternalUserId method on Android. This is only applicable on ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found