我正在尝试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连接?
任何帮助,将不胜感激。