Restore transactions of in-app purchases in another app

[亡魂溺海] 提交于 2019-12-11 14:25:04

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!