我正试图在我的Cordova应用程序中为iOS购买应用程序。
到目前为止,我尝试使用两个插件:- https://github.com/AlexDisler/cordova-plugin-inapppurchase - https://github.com/j3k0/cordova-plugin-purchase
他们都不管用。因为上一个插件使用了某种定制的收据验证平台,所以我决定跳过这个平台。
我的第一个插件代码如下所示:
window.inAppPurchase
.getProducts([subscriptions.FLOXER_PRO_IOS_PRODUCT_ID])
.then(function(products) {
console.log(products);
window.inAppPurchase
.buy(subscriptions.FLOXER_PRO_IOS_PRODUCT_ID)
.then(function(data) {
console.log(data);
})
.catch(function(err) {
console.log(err);
});
})
.catch(function(err) {
console.log(err);
});Safari控制台日志输出:
[Log] [] (0) (bundle.js, line 67)
[Log] {errorMessage: "Unknown product identifier", errorCode: 100} (bundle.js, line 67)XCode日志:
2016-11-07 11:46:32.940653 Floxer[831:207602] Using UIWebView
2016-11-07 11:46:32.942682 Floxer[831:207602] [CDVTimer][handleopenurl] 0.057995ms
2016-11-07 11:46:32.943943 Floxer[831:207602] [CDVTimer][intentandnavigationfilter] 1.214981ms
2016-11-07 11:46:32.944015 Floxer[831:207602] [CDVTimer][gesturehandler] 0.042021ms
2016-11-07 11:46:32.944038 Floxer[831:207602] [CDVTimer][TotalPluginStartup] 1.437962ms
2016-11-07 11:46:33.316991 Floxer[831:207602] Resetting plugins due to page load.
2016-11-07 11:46:34.149838 Floxer[831:207602] Finished load of: file:///var/containers/Bundle/Application/0CFA94CE-294B-43C8-8BCD-28C76B8F303E/Floxer.app/www/index.html
2016-11-07 11:46:42.654647 Floxer[831:207602] RMStore: products request received response
2016-11-07 11:46:42.654829 Floxer[831:207602] RMStore: invalid product with id com.coqtail.floxer.pro_account
2016-11-07 11:46:42.676313 Floxer[831:207602] RMStore: unknown product id com.coqtail.floxer.pro_account
2016-11-07 11:47:34.804099 Floxer[831:207602] RMStore: products request received response
2016-11-07 11:47:34.804265 Floxer[831:207602] RMStore: invalid product with id com.coqtail.floxer.pro_account
2016-11-07 11:47:34.870319 Floxer[831:207602] RMStore: unknown product id com.coqtail.floxer.pro_account我正在为iOS使用一个模拟器(没有登录),这会是一个潜在的问题吗?你需要一个真实的帐户来测试应用程序的购买吗?
我在iTunes连接中创建了我在应用程序中的购买,但是它还没有被批准。这不应该是个问题吧?我想,在测试期间,您不需要在App中进行验证。
以前有人经历过这个问题吗?我已经搜索谷歌好几天了,似乎找不到解决这个问题的明确办法.
我会很感激你的帮助!
发布于 2017-01-12 09:11:48
我也有过类似的问题。我在gitHub上找到的答案对我有用:
您需要在iTunes连接中有一个“付费应用程序”合同才能显示您的付费产品。要做到这一点,请访问您的iTunes连接主页并选择“协议、税收和银行业务”。填写您的联系方式,银行和税务信息。提交表格,等待15分钟合同处理。
一个很好的测试方法是添加一个免费的消费品,这不需要一个‘付费应用’合同。
感谢@stoconnor
https://stackoverflow.com/questions/40463558
复制相似问题