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

getProducts returns empty array in v.2.4.8 in iOS 12.x + #541

Closed
nohaapav opened this issue Jun 20, 2019 · 8 comments
Closed

getProducts returns empty array in v.2.4.8 in iOS 12.x + #541

nohaapav opened this issue Jun 20, 2019 · 8 comments
Labels
🙏 help wanted Extra attention is needed 📱 iOS Related to iOS 👣 waiting for response Need feedback to continue

Comments

@nohaapav
Copy link

nohaapav commented Jun 20, 2019

Version of react-native-iap

2.4.8

Version of react-native

0.55.4

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

iOS 12.x +

Expected behavior

I should get list of products

Actual behavior

I get empty array

Tested environment (Emulator? Real Device?)

Real device -> iPhone SE, iOS 12.3.1
Emulator -> iOS 12.1 (Multiple devices)

Steps to reproduce the behavior

In-App Purchase is created in Ready to Submit status [Non-Consumable]

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

async componentDidMount() {
    await RNIap.initConnection()
    const products = await RNIap.getProducts(itemSkus)
    console.log(products)
}

initConnection returns true
getProducts returns []

Sku array with my_product_id match the one from App Store Connect

I did basically everything from Q/A and different blog posts
without any luck.

Update:
I did some additional debugging and it looks like RNIapIos.getItems(skus) returns []

@nohaapav nohaapav changed the title getProducts returns empty array in v.2.4.8 with in iOS 12.x + getProducts returns empty array in v.2.4.8 in iOS 12.x + Jun 20, 2019
@hyochan hyochan added 🙏 help wanted Extra attention is needed 📱 iOS Related to iOS labels Jun 20, 2019
@hyochan
Copy link
Member

hyochan commented Jun 20, 2019

Related #407. <== Could you follow the related issue and come back?

@hyochan hyochan added the 👣 waiting for response Need feedback to continue label Jun 20, 2019
@nohaapav
Copy link
Author

@hyochan Right, my Paid Apps agreements was not active but pending .. Closing :)
Thanks for help.

@dhamnesh
Copy link

I am facing the same issue, getting an empty array from the getProducts() method.

react-native-iap - 2.4.8 & react native version - 0.56.0.

It is working properly on native iOS with the same id.

How to resolve it?

@srhtylmz19
Copy link

i strongly suggest you to check out link . i mean controll your build phaese->link binary with libraries (i was not able to see libRNAap.a even i did react-native link react-native-iap) then i linked manually and its working now.

@cantonalex
Copy link

Thanks @srhtylmz19 fixed it for me!

@ManalLiaquat
Copy link

I solved it! I am using these versions,

react-native-iap: ^4.3.0
react-native: 0.60.5

just do it like this

const itemSkus = Platform.select({
    ios: [
        '100coins' // just remove bundle id from product id
    ],
    android: [
        '100coins' // just remove bundle id from product id
    ]
});

@muganwas
Copy link

muganwas commented Apr 3, 2020

I had this issue and it turns out I'd skipped installing the RNIap in the pod file
ie. copy and paste this pod 'RNIap', :path => '../node_modules/react-native-iap' then cd ios && pod install && cd ..(run terminal commands from the application directory)

@Foxxiblak
Copy link

I thought about it for a long time, then I checked the purchase status in appstoreconnect, it was "Metadata missing". As soon as it filled in all the data (including information for verification), the purchase moved to the "Ready to ship" status and the getProducts method stopped returning []

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 👣 waiting for response Need feedback to continue
Projects
None yet
Development

No branches or pull requests

8 participants