React-native-iap: Wishlist for 2.0

Created on 15 Aug 2018  Β·  13Comments  Β·  Source: dooboolab/react-native-iap

Just started using this library and noticed a few shortcomings that I would love to get fixed before 2.0 is out as stable:

  • [x] Remove RNVersion as parameter from validateReceipt* (just read this from react-native or simply drop support for old versions)
  • [ ] Proper error handling

    • [ ] Add code property to all errors
    • [x] Let prepare throw an error when payments are disabled on iOS

    Currently, this method is documented as 1) being a noop and 2) returning Promise<void>. The reality is that it returns the string "false" on iOS when payments aren't enabled.

    I think it should return Promise<void> on iOS, but reject with an error (e.g. PAYMENTS_NOT_ENABLED) when payments aren't enabled.

    • Let validateReceiptIos reject on Android (e.g. WRONG_PLATFORM) (better to have it just work on both platforms)
    • [x] Let validateReceiptIos reject instead of returning false and printing to console
  • [x] Fix validateReceiptAndroid (it always returns false for React Native >= 0.54)
  • [ ] Update documentation for getProduct and getSubscription to remove note about not making a difference with product/subscriptions (this have been fixed with a .filter() in the code)
  • [x] Possibly rename prepare and endConnection to better match each other

    • e.g. initConnection/endConnection or prepare/teardown or something else entirely

  • [ ] Abstract away the different types on iOS/Android (e.g. inapp vs iap), just make sure that type is the same on both platforms.
  • [ ] Abstract away the differences between price/localizedPrice on iOS/Android

    • Currently price is localized on Android, but not on iOS

    • Would like to change so that price is a number, and localizedPrice is string

Most of these changes are breaking changes which is why I would love to get them in before final 2.0.

I would be happy to submit pull requests for all of the items above 🌻 😎

πŸ— enhancement πŸƒπŸ»β€β™€οΈ in progress 🚢🏻 stale

All 13 comments

@LinusU Thanks. We will make this as a todo list before submitting to stable 2.0. Will love your PR too.

Nice! Thanks!

Feel free to start with #235 ☺️

238 addresses the first point

(added point about price/localizedPrice to first post)

@dooboolab do you want to merge #235 and #238, and tag a new alpha? Would love to get those changes in ☺️

Or do you want to accumulate all the changes in one big release? I personally prefer keeping incremental, but I'm fine either way πŸ‘

@LinusU Merged in 2.0.0-alpha9. Thank you for the work!

Awesome! Thanks, really appreciate a release, it helps me keep up with the changes in my app ❀️

Next in line πŸ˜„ #242

@LinusU I've released to 2.0.3 today. You may check what's left and could give us a PR. Thank you.

Can i add a request?

In IOS, a way to check if a subscription is still active or not.

In Android you can check the autoRenewal flag, but on ios there is no way to do that.

Regards

@marcosmartinez7 I would recommend opening a separate issue for that. The idea with this issue was to track what _breaking_ changes we wanted to get in. I'm guessing that adding that would be backwards compatible ☺️

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

Was this page helpful?
0 / 5 - 0 ratings