簡體   English   中英

在應用內購買Cordova插件

[英]In app purchases Cordova Plugin

我為我的IOS應用程序使用Cordova Plugin應用程序內購買( 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產品類型

完成后,易耗品將返回到“有效”狀態,而其他產品將進入“已用”狀態。

嘗試使用NON-CONSUMABLE產品類型。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM