如何在两个Android应用之间共享应用内购买 [英] How to share in-app-purchases between two Android apps

查看:112
本文介绍了如何在两个Android应用之间共享应用内购买的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个android应用(app1和app2),它们都是免费的,但是app2包含应用内购买升级.

I have two android apps (app1 and app2), both of them are free but app2 contains an in-app-purchase upgrade.

现在,我将把这两个应用程序合并到app1(一个没有应用程序内购买的应用程序)中.

Now I'm going to merge those two apps into the app1 (the one without the in-app-purchase).

我的问题是:

  • 我如何保留app2中已经消费的购买,以便购买它的每个人都可以在合并的应用程序中享受升级?我知道我可以共享首选项,但是我不想让用户继续拥有这两个应用程序.

  • How can I preserve the purchase that was already consumed in app2 so everyone who bought it will enjoy the upgrade on the combined app? I known I can share preferences, but I don't want to user to keep having both apps.

假设某位用户在app2上购买了应用内购买升级程序,则尝试将新的组合app1安装到另一台设备上-当我什至没有在另一台设备上安装app2时,如何从app2还原购买的商品(而且可能也不会在Google Play上提供)?

Let's say a user that purchased the in-app-purchase upgrade on app2 tries to install the new combined app1 into another device - how can I restore his purchase from app2 when it is not even installed on the other device (and probably won't be available on Google Play too)?

谢谢

推荐答案

不幸的是,这是不可能的.应用内购买直接与首次创建应用时使用的唯一package-id绑定.

Unfortunately, this is not possible. The in-app purchases are directly tied to the unique package-id used when the applications were first created.

保留app2的应用内购买的唯一方法是将app1合并到app2中,从而保留该应用的购买.最后,如果那行不通,则您必须使用Google Play服务以外的其他服务来手动推出解决方案.

The only way you could preserve app2's in-app purchase would be to merge app1 into app2, thus preserving the app's purchases. Finally, if that won't work, you'd have to hand roll a solution using a service other than Google Play Services.

这篇关于如何在两个Android应用之间共享应用内购买的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆