我正在嘗試phonegap和應用程序購買。我都是新來的應用程序購買。Phonegap:在應用購買自動更新訂閱?
我使用這個插件:
https://www.npmjs.com/package/cc.fovea.cordova.purchase
基本上我需要做的是創建一個簡單的應用程式,讓3天的免費試用,然後停止工作或給出錯誤或警告或者任何事情(只是停止工作,並阻止用戶使用應用程序),直到他們有一個積極的自動更新訂閱。
到目前爲止,我發現的每一個信息和教程都是關於耗材和非消耗品的。
我需要學習的是auto-renewing subscription purchase
。
我跟着本指南在iTunes中創建一個產品連接帳戶:
https://github.com/j3k0/cordova-plugin-purchase/wiki/HOWTO#create-ios-applications
我在我的PhoneGap謨添加以下代碼:
// We must wait for the "deviceready" event to fire
// before we can use the store object.
document.addEventListener('deviceready', initializeStore, false);
function initializeStore() {
// Let's set a pretty high verbosity level, so that we see a lot of stuff
// in the console (reassuring us that something is happening).
store.verbosity = store.INFO;
// We register a dummy product. It's ok, it shouldn't
// prevent the store "ready" event from firing.
store.register({
id: "XXXXXXX",
alias: "Upgrade Membership",
type: store.PAID_SUBSCRIPTION
});
// When every goes as expected, it's time to celebrate!
// The "ready" event should be welcomed with music and fireworks,
// go ask your boss about it! (just in case)
store.ready(function() {
console.log("\\o/ STORE READY \\o/");
alert('\\o/ STORE READY \\o/');
});
// After we've done our setup, we tell the store to do
// it's first refresh. Nothing will happen if we do not call store.refresh()
store.refresh();
}
現在,我有問題是:
有什麼特別的cific,我需要做的檢查,看看是否 用戶有活躍的訂閱?或蘋果會自動爲我做 ?
什麼其他東西我需要知道應用程序自動更新 購買功能?
是
type: store.PAID_SUBSCRIPTION
用於自動續訂訂閱?是
id: "XXXXXXX",
我的應用程序包ID或其產品ID 它顯示在iTunes連接?
任何幫助,將不勝感激。