【问题标题】:iOS In app purchase - Unknown product identifieriOS 应用内购买 - 未知产品标识符
【发布时间】:2017-03-20 16:49:14
【问题描述】:

我正在尝试在我的 Cordova 应用程序中使用适用于 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 中创建了我的应用内购买,但尚未获得批准。这应该不是问题吧?我假设您在测试期间不需要经过验证的应用内购买。

以前有人遇到过这个问题吗?我在谷歌上搜索了几天,似乎找不到解决这个问题的明确方法......

我们将不胜感激!

【问题讨论】:

    标签: xcode cordova in-app-purchase app-store-connect itunes-store


    【解决方案1】:

    我遇到了类似的问题。我在 gitHub 上找到的答案对我有用:

    您需要在 iTunes Connect 中拥有“付费应用程序”合同才能显示您的付费产品。为此,请转到您的 iTunes Connect 主页并选择“协议、税务和银行业务”。填写您的联系方式、银行和税务信息。提交表格并等待 15 分钟以处理合同。

    一个很好的测试方法是添加一个免费的消耗品,这不需要“付费应用程序”合同。

    感谢@stoconnor

    【讨论】:

      猜你喜欢
      • 2017-09-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-02
      • 1970-01-01
      • 1970-01-01
      • 2011-12-10
      相关资源
      最近更新 更多