问题
I have read other threads here and they say that In-app purchases are stored as long as "managed" purchase type is chosen when in-app billing is set up. Managed means that when the app is reinstalled, it can ask the in-app billing service which items this particular user has already purchased. I have set up "managed" purchase type in all my apps with In-app billing. The purchases are still lost when the apps are uninstalled and then installed again. I tested with a test account as a alpha tester. The customers say the same thing.
Why does this happen? Do I really need to use a backupAgentHelper to solve this? Shouldn't this be solved by Google when I choose "managed" purchase type?
回答1:
You're right, you can query the in-app billing service to get the items a user has purchases, as long as you haven't 'consumed' the item. As soon as you consume the purchase, you can no longer query the in-app billing service to get that item. Are you making a call that looks something like this?
iabGooglePlayHelper.mService.consumePurchase(3, getPackageName(), purchaseToken);
If so, then you're consuming it. If that is not the case, then it may be with how you're querying the in-app billing service. Can you pose that code if you believe it to be the problem?
来源:https://stackoverflow.com/questions/38460219/in-app-purchases-are-lost-after-uninstall-on-managed-purchase-type