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

Invalid product Id on iOS #304

Closed
BakytzhanAkzhol opened this issue Oct 29, 2018 · 11 comments
Closed

Invalid product Id on iOS #304

BakytzhanAkzhol opened this issue Oct 29, 2018 · 11 comments
Labels
🙏 help wanted Extra attention is needed 📱 iOS Related to iOS

Comments

@BakytzhanAkzhol
Copy link

BakytzhanAkzhol commented Oct 29, 2018

Version of react-native-iap
2.3.17

Main Library
expo: "30.0.0"
react: "16.3.1"
react-native: 30.0.0 from expo server

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

Expected behavior
Returning list of subscription
Buy subscription

Actual behavior
Our app is already approved and ready for sale on App Store and all products is "Ready for Submit" but still when i call RNIap.getSubscriptions it returns empty [] and I call buySubscription(ProductId) it returns "Product Id Invalid"

Tested environment (Emulator? Real Device?)
Emulator and real device

Steps to reproduce the behavior
I make all steps in the tutorial.
Make sandbox user in Role & Users and connect to real device.
Make two items form subscription.
RNIap.initConnection always return true.

Question:
Q1: I need some backend for working with RNIap?
Q2: Can i get list of subscription in emulator or real device without publish to Testflight?

My code:

const itemSubs = Platform.select({
  ios:[
   'neupusti.1month',
    'neupusti.subs.6month'
  ],
  android: [],
});
...
  async componentDidMount() {
    try {
      const result = await RNIap.initConnection();
      console.log('result', result);

       Alert.alert("RNIAP is connected: "+result);
    } catch (err) {
      console.warn(err.code, err.message);
    }
  }
...
 getSubscriptions = async() => {
    try {
      const products = await RNIap.getSubscriptions(itemSubs);
      console.log('Products', products);
      this.setState({ productList: products });
    } catch (err) {
      console.warn(err.code, err.message);
    }
  }
...
buyItem = async(sku) => {
    try {
      console.info('buyItem: ' + sku);
      // const purchase = await RNIap.buyProduct(sku);
      const products = await RNIap.buySubscription(sku);
      // const purchase = await RNIap.buyProductWithoutFinishTransaction(sku);
      console.info(products);
       Alert.alert(JSON.stringify(products));

      this.setState({ receipt: purchase.transactionReceipt }, () => this.goToNext());
    } catch (err) {
      console.log(err);
      console.warn(err.code, err.message);
      Alert.alert(err.message);
    }
  }

p.s. I spent 3+ days searching for a solution and nothing helped me.

@hyochan hyochan added 🙏 help wanted Extra attention is needed 📱 iOS Related to iOS labels Oct 29, 2018
@hyochan
Copy link
Member

hyochan commented Oct 29, 2018

Q1: no
Q2: Have you gone through medium I've posted? It says you don't need to upload the app the testflight for testing this feature. You just need to do the step in the medium.
image

Make sure your product is in Ready To Submit status.

@BakytzhanAkzhol
Copy link
Author

BakytzhanAkzhol commented Oct 30, 2018

Hi, I read your article and made this step.But, I still can't get list subscriptions.
Right now, I have one item for subscription in purchase.
2018-10-30 10 44 23

@hyochan
Copy link
Member

hyochan commented Oct 30, 2018

I can't read your language so are you sure it is in Ready to Submit state?

@hyochan
Copy link
Member

hyochan commented Oct 30, 2018

Also please refer to #256 who've explained the config step in detail.

@BakytzhanAkzhol
Copy link
Author

I can't read your language so are you sure it is in Ready to Submit state?

Yes, It says Ready to Submit. I forgot to translate for you. Sorry.

@hyochan
Copy link
Member

hyochan commented Oct 31, 2018

Please refer to #256 and try again

@hyperh
Copy link

hyperh commented Nov 6, 2018

Hmm having similar issues with invalid productId

@hyochan
Copy link
Member

hyochan commented Nov 6, 2018

Did you go over above issue I’ve mentioned?

@hyperh
Copy link

hyperh commented Nov 7, 2018

@dooboolab Thanks for the link. Followed it and it worked. Thanks for your great work on this library!

@JJMoon
Copy link
Contributor

JJMoon commented Nov 8, 2018

Nice to hear the issue was resolved. I'm closing this issue.

@JJMoon JJMoon closed this as completed Nov 8, 2018
@BakytzhanAkzhol
Copy link
Author

BakytzhanAkzhol commented Nov 14, 2018

Problem solved.. My mistake was incorrectly filled out a tax form on the site Apple. Thank you)

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

No branches or pull requests

4 participants