question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

  • 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

    • 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)

    • Let validateReceiptIos reject instead of returning false and printing to console

  • 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)
  • 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 🌻 😎

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
LinusUcommented, Sep 27, 2018

@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 ☺️

1reaction
LinusUcommented, Aug 16, 2018

@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 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

What site/app do you use to make wishlists for 2.0?
It makes it miserable for me to make any wishlists. VillagerDB is what I mainly use and prefer. They don't have the 2.0.0...
Read more >
10. Wish list for version 2.0
Wish list for version 2.0. The following is a list of suggestions (in no particular order) that I did not have time to...
Read more >
Software infrastructure 2.0: a wishlist - Erik Bernhardsson
Software infrastructure (by which I include everything ending with *aaS, or anything remotely similar to it) is an exciting field, in ...
Read more >
My Gunpla Wishlist for 2.0s and Revives [Question of the Week]
Get the Mecha Novel Strength of a Thousand (Ebook & Paperback) Here: https://www.amazon.com/dp/B086DCSYQL/Get the Kindle App Here: ...
Read more >
Wishlist 2.0 aka: Keeping an eye on... - MyFigureCollection
Great Figures, Amazing Service, Fantastic Price! ... Just a neat little list of figures I'm interested in. Basically my secondary wishlist, while my...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found