BAD CONSUMPTION FUNCTIONALITY!!
See original GitHub issuerefreshAllItems
is very poorly named!! The implementation uses fetchHistory
on iOS which is non-mutative operation, and uses consumeItem
on Android, which destroys purchase history! This is either very bad naming, or very poor purchase flow behaviour! I’ll nominate it for both!
I can’t think of a single case where I’d want to immediately consume all purchased items. What I would expect is that refreshAllItems
re-synchronizes the device purchase history with Google Play and the App Store (ie. getPurchases
) – this should absolutely be changed so more people don’t make this mistake.
I even checked the source code to make sure I had the right idea about what was going on, but I got as far as getPurchases
on the Android side and stopped reading. I didn’t notice this module was automatically consuming those purchases!!
Here’s my suggestion for a fix: rename refreshAllItems
to refreshPurchases
, and ONLY fetch the user’s purchase history. Do NOT consume items automatically. Consuming behaviour is it’s own flow which should be managed by the application developer, ie explicitly calling consumeItem(...)
or something similar.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:15 (13 by maintainers)
@dooboolab No worries, I know it can be hard to balance personal and day job projects. Will start by spending some time reading through the codebase, @lwansbrough fork, and currently reported issues.
@javier-artiles You can see the remaining issues in this repo. Testing local receipt validation might be useful too. Also, before all that, we need to test @lwansbrough code and update readme and announce users for migration who’s already using our module. I am running out of time and testing is bit delayed. Sorry for that.