Navigation Menu

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 newest version RN #451

Closed
augustbjornberg opened this issue Apr 9, 2019 · 9 comments
Closed

getProducts returns empty array in newest version RN #451

augustbjornberg opened this issue Apr 9, 2019 · 9 comments
Labels
🙏 help wanted Extra attention is needed 📱 iOS Related to iOS

Comments

@augustbjornberg
Copy link

Version of react-native-iap

^2.4.7

Version of react-native

0.59.4

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

iOS

Expected behavior

I expect getProducts to return an array of available purchases.

Actual behavior

The returned device is empty.

Tested environment (Emulator? Real Device?)

Both.

Steps to reproduce the behavior

yield RNIap.prepare()
const products = yield RNIap.getProducts(iapBundleIds(content))

console.log(iapBundleIds(content))
// ["org.truthordrink.TruthOrDrink.pack1", "org.truthordrink.TruthOrDrink.pack2", "org.truthordrink.TruthOrDrink.pack3"]
console.log(products)
// []

The above code in the same xcode project works correctly using:
"react-native": "0.56.0",
"react-native-iap": "^2.4.0-beta6"

@hyochan
Copy link
Member

hyochan commented Apr 10, 2019

There are several issues related to this which are already closed. Please follow that and this should be working.

@hyochan hyochan closed this as completed Apr 10, 2019
@hyochan hyochan added 🙏 help wanted Extra attention is needed 📱 iOS Related to iOS labels Apr 10, 2019
@augustbjornberg
Copy link
Author

augustbjornberg commented Apr 10, 2019

Only one i could find that remotely matched mine was #340.

For me, the module is working as expected in react-native 0.56.0, but not react-native 0.59.4, can't find any ticket related to that. If you could point me to a ticket like that it would be very helpful.

I'm just gonna roll with 0.56.0 for now, but you should know that the module is not working in 0.59.4.

@cesarve77
Copy link

Same problem here

@andrewdazs
Copy link

Same here

@npedrini
Copy link

I'm seeing the same. Are there any plans to address what seems like a confirmed issue with 0.59.4?

@Polelo-Monareng
Copy link

Why is this issue even closed? getProducts returns empty array in react-native 0.59.8 as well.

@npedrini
Copy link

npedrini commented Jun 1, 2019

@hyochan: per your above comment that presumably resulted in this issue being closed, please kindly let us know what issues this one duplicates.

This is the only library of its kind that I know of, AND it is not working in current versions of RN. It would be great to get a better sense of what the issue is so the community can work towards getting it resolved. We need this library!

@hyochan
Copy link
Member

hyochan commented Jun 20, 2019

Related #407

@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
    ]
});

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

7 participants