React-native-iap: getProducts and getSubscriptions seem to share their parameters

Created on 22 Nov 2018  ·  3Comments  ·  Source: dooboolab/react-native-iap

Version of react-native-iap

2.3.19

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

iOS

Expected behavior

The docs for these functions mention, that they might return subscriptions if they are included in the list of SKUs. so in a call like:

const subs = await getSubscriptions(['sku2', 'sku3']);
const prods = await getProducts(['sku1']);

I would expect to only get the products / subscriptions referenced by the SKUs supplied.

Actual behavior

Surprisingly after executing the above code both prods and subs contain 3 items, a mixture of subscriptions and products even though I separated them when calling the methods. After removing e.g. 'sku2' from one method call, the output of the other function also changes, the product vanishes from both returned arrays. It seems like there are some undocumented side effects going on here.

Tested environment (Emulator? Real Device?)

real Device

Steps to reproduce the behavior

iOS only bug:

  • Create subscriptions and products
  • call the functions as described above
  • examine the returned array
🍗 enhancement 🐛 bug 📱 iOS

All 3 comments

Yes. the two methods call the same native objective-c methods, getItems().
You can use this module with knowing this issue, but we will fix the code and document sooner or later.
Thank you for your concern.

I hope this is remind.. Closing this issue.

document still not updated yet. ios side getProducts and getSubscriptions seems to no difference.

Was this page helpful?
0 / 5 - 0 ratings