Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IAB consumePurchase() no longer works for static response android.test.purchased

Our beta app uses android.test.purchased so customers can test for free. But recently something broke with consuming these test products. The purchase process still works fine but when we try to consume:

int response = ms.consumePurchase(3, mContext.getPackageName(), token);

This now always returns RESULT_DEVELOPER_ERROR == 5. The data passed appears valid, token is inapp:com.lootworks.swords:android.test.purchased which I think is correct for the static test products.

Simultaneously all our earlier app versions also stopped working and we did not change our code, so it sure seems like something changed with IAB itself.

I also tested purchase/consume of the real (for $) products and it succeeds with the same code. So the consume problem seems to affect only the static response test item.

like image 259
mwk Avatar asked Feb 18 '23 05:02

mwk


2 Answers

With Sean's help and some additional testing this appears to be a google play IAB regression. Have opened a bug https://code.google.com/p/android/issues/detail?id=53077

like image 174
mwk Avatar answered Apr 09 '23 14:04

mwk


My team and I are experiencing this same issue. Nothing has changed with the app consume code, so it is very strange. The app is not release-ready yet, so we have plenty else to work on, but this throws a monkey wrench into testing for sure.

This may not be an option for you, but you could change the namespace, delete the app entry in the dev console and go through the process of making a new one, and splitting the key up again, etc.

I only suggest this because this problem does not seem to be happening for all apps. Anyway, if the consume in our app does not start magically working again soon, this is what we will try.

like image 39
Sean Richardson Avatar answered Apr 09 '23 14:04

Sean Richardson