类型 库 修订版 发布版本 2024.3703 关键字 谷歌,IAP,应用内购买 平台 安卓
此插件已弃用。请迁移到 Google Billing。有关更多信息和主要差异,请参阅其 文档。
借助 Google IAP 插件,你可以支持
如需在其他平台进行应用内购买,请参阅 Apple IAP、Amazon IAP 或 Store API 的文档。
如需使用 Google IAP,请先设置 Google Payments Merchant Center 帐户,并将其链接到 Google Play Developer Console。
必须在 Google Play Developer Console 内执行额外配置。如果你需要此流程的帮助,请参阅 Google 的 文档。
local store = require( "plugin.google.iap.v3" )
如需使用此插件,请在 build.settings 的 plugins 表中添加一个条目。添加后,构建服务器将在构建阶段集成该插件。
settings =
{
plugins =
{
["plugin.google.iap.v3"] =
{
publisherId = "com.coronalabs"
},
},
}
此外,你必须在 build.settings 中启用 BILLING 权限
settings =
{
android =
{
usesPermissions =
{
"com.android.vending.BILLING",
},
},
}
最后,必须将 license 表添加到项目的 config.lua 文件中。在此表内,key 值应设置为从 Google Play Developer Console 获得的相应密钥。
application =
{
license =
{
google =
{
key = "YOUR_KEY",
},
},
}