dooboolab-community / react-native-iap

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

products -> empty array and getProduct return undefined #2634

Open sexyboyjayden opened 10 months ago

sexyboyjayden commented 10 months ago

Please use the Discussion board if you want to get some help. Please use issues to report bugs.

Description

I am currently trying to implement in-app purchases for consumable products using react-native-iap in my unreleased first app. I have followed the procedures outlined in the documentation, and I am testing it on a real device. However, the products array is coming out empty, and getProducts is returning undefined.

The in-app product status is currently 'Ready to Submit.' Is it possible to retrieve product information in the code after the first version of the app, which has not yet been submitted for review, passes the review process?

Expected Behavior

get product info in my console

Screenshots

스크린샷 2023-12-04 오후 4 06 42

<img width="1503" alt="스크린샷 2023-12-04 오후 4 06 15" src="https://github.com/dooboolab-community/react-native-iap/assets/119939348/77d16287-

스크린샷 2023-12-04 오후 4 03 52

d5ad-4972-a353-4c25dee402cd">

Environment:

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Press '...'
  3. Error '...' is shown

[Optional] Additional Context

minhDaiVatek commented 6 months ago

+1

PatriciaSauer commented 4 months ago

Edit: I got it working now 🥳

I thought I would have to use the format bundleId.productId as sku where it was just productId for retrieving products.

I guess I learned that one should include the bundleId in a product ID in App Store Connect, i.e. com.my-bundle-id.my-product instead of my-product, which was the case for me. But since the examples contained always a bundle ID that seems to be best practice.