在 library/SDK 中提供应用内结算

Offering In-App Billing in a library/SDK

Google groups 上有一个问题:

Our main app offers In-App Billing for different advanced features. Recently we've wrapped our code in an AAR file which offers some basic functionality for free, but we would like to offer In App Purchases for advances features. Since we will be used by other applications as an SDK, and those applications might have their own IAB implementations and their own SKUs, we aren't sure if there is a way to still use the same Application ID and SKUs defined for our main app when trying to purchase something related only to the SDK part of the code, or would that be against the rules and wouldn't work because of public key used to verify the signature wouldn't match the private key of our main app?

我有同样的问题,所以问题仍然存在,非常欢迎任何建议。

谢谢!!

we aren't sure if there is a way to still use the same Application ID and SKUs defined for our main app when trying to purchase something related only to the SDK part of the code

这是行不通的,因为每个应用都需要有不同的包名称(应用程序 ID)、不同的 API 密钥,并且需要使用不同的密钥库进行签名。应用内商品需要为每个应用设置,您无法控制定价。您应该考虑不同的获利策略。

we aren't sure if there is a way to still use the same Application ID and SKUs defined for our main app when trying to purchase something related only to the SDK part of the code

如果您通过应用程序 ID 表示打包,则在将应用程序上传到 google 播放时无法完成此操作。每个应用程序都必须有自己的包(应用程序 ID)。然后每个应用程序都会有一个不同的 base 64 密钥,并使其他应用程序无法访问应用程序内项目。

可能的解决方案:

(这是基于我正确理解了问题)

Our main app offers In-App Billing for different advanced features.[...] Since we will be used by other applications as an SDK[...]

WordPress 和设计示例:

我用的是观星主题(parent),这个有很多sub-themes(children)。这些设计中的每一个都有 small-large 覆盖现有设计的更改,但不包含原始设计中的所有代码,需要安装 parent 才能工作。没有 parent 它没有必要的主代码(或 SDK)来工作。

因此,如果用户拥有 child 应用程序,该应用程序将 parent 应用程序与 IAB(应用程序内计费)用作某物的 SDK,则需要 parent 应用程序安装它工作。如果没有 parent 应用程序,child 应用程序将无法正常工作。如果它访问由 parent 应用程序创建和分发的功能,则有很多通信机制(用于 inter-app 通信(parent 到 child 具有功能数据,用于购买的功能) ) 但 child 应用随后将从主应用获取数据并解锁 child 应用中的本地功能。

此处的 parent 应用基本上会提供应用内购买以改进功能。但是,我不确定这些功能如何。考虑到前面的 wordpress 示例,child 应用程序会覆盖主应用程序的功能实现:

主应用程序中有些东西可以使用,但是 children 会更改这些功能(覆盖)主应用程序。

这是行不通的,因为每个已发布的应用程序都有自己唯一的密钥库文件,该文件指定了它们的包和一些信息。 此外,每个应用程序都有自己的购买项目。

这个我已经看过了。 当然是我的错。 当我使用相同的密钥库文件发布时,我的应用程序被拒绝了。 所以我重新发布了新的密钥库文件。 希望我的建议对您有所帮助。