We have implemented in-app purchases for buying a set of consumables from both the Apple and Google stores. Basically we set up product identifiers x, y and z on both the Apple and Google stores and then pass whatever the user is buying to Store.purchase.
The entire thing works fine for the Apple store.
For the Google store, the first app purchase works fine, but subsequent purchases always return the product identifier for whatever was purchased first. To Google, the product identifier is what we passed to Store.purchase, but what we get back in the Store’s listener as a product identifier is not correct.
Also, in the receipt, all of the user’s purchases are listed (correctly). My shot-in-the-dark guess is that because they’re all listed, something somewhere is just taking the first bought thing from the receipt and using that as the product identifier.
To reiterate:
- We initialize the store with store.init(“google”, purchaseHandler) - where purchaseHandler is our listener.
- We pass the product identifier (call it x) to Store.purchase.
- purchaseHandler is called with event.transaction.productIdentifier == x, everything works peachy.
- For the same user, we pass a different product identifier (call it y) to store.purchase.
- This time purchaseHandler is still called with event.transaction.productIdentifier == x, not y as it should be.
- event.transaction.receipt shows both purchases with seemingly correct information.
Now, as with anything like this, we could always be doing something wrong, but we’re handing off the right value and getting back a different value with none of our code in between, so that seems sketchy. And, as I said, it works fine with the Apple store.
Has anyone else experienced this, is this a bug, or are we doing some sort of crazy bad config that’s causing this?
For now I’m going to work around it by just using the product identifier I passed locally without accepting that the one passed back is accurate, but that seems like an unnecessary workaround if we were being passed the right thing.
Thanks!