问题
Using In-App Billing v3 and the IabHelper
class provided by Google. Using its queryInventoryAsync
method, it's easy to restore the user's transactions of my app. Now comes the tricky part! I need to restore transactions of another app of mine. Can that be done?
- Both apps have been signed with the same key.
- Both apps are published under the same developer account.
- Both apps happen to have the same sharedUserId (and I hope to keep it that way).
I know the use of sharedUserId
can cause problems with IAB v3
but for this particular task I believe it should be possible to get it working. Any help is greatly appreciated!
The motivation for this feature is simple. Any in-app purchases made in my Basic app should be made available in my Pro app, without forcing the user to buy the equivalent items anew.
回答1:
This cannot be done. iABHelper provides information based on your package name id which gets automatically passed from your app. Since your other application has different package name those purchases are not going to return at all. All you can do is to send broadcast from one app to another and process that request in other application and send that information back in first app.
来源:https://stackoverflow.com/questions/25100035/restore-transactions-of-in-app-purchases-in-another-app