gpt4 book ai didi

javascript - 应用内购买 Cordova 插件

转载 作者:行者123 更新时间:2023-11-28 07:11:45 25 4
gpt4 key购买 nike

我在我的 IOS 应用程序中使用 Cordova 插件应用内购买 ( https://github.com/j3k0/cordova-plugin-purchase/blob/master/doc/api.md#refresh )。

我完全按照他们的代码示例所示进行操作:

  store.register({
id: 'credits_test',
alias: 'credits_advance',
type: store.CONSUMABLE
});

store.refresh();

store.when("credits_test").approved(function (product) {
product.finish();
updateCreditsPurchased(p.token, 1, product ints[0]);
});

$(".btn").click(function()
{
store.order("credits_test");
})

我的商店对象上没有任何验证器,我使用我的沙箱帐户进行测试。

现在,由于某种原因,产品状态始终是“有效”,即使是在我触发“完成”事件之前的 APPROVED 事件中,而且我还在控制台日志中看到产品卡在队列中。

有什么想法吗?

最佳答案

这是正确的行为,因为您选择了 CONSUMABLE 产品类型

When finished, a consumable product will get back to the VALID state, while other will enter the OWNED state.

尝试使用NON-CONSUMABLE产品类型。

来源:https://github.com/j3k0/cordova-plugin-purchase/blob/master/doc/api.md

关于javascript - 应用内购买 Cordova 插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31233024/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com