我試圖在我的Cordova應用程序中用於iOS應用程序購買。iOS在應用程序內購買 - 未知產品標識
到目前爲止,我嘗試使用2個插件: - 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 Connect中創建了我的應用程序內購買,尚未獲得批准。這不應該是個問題吧?我假設你在測試過程中不需要經過驗證的In App Purchase。
以前有沒有人遇到過這個問題?我現在搜索谷歌幾天,似乎無法找到一個明確的解決方案,這個問題...
幫助,將不勝感激!