【问题标题】:In-App Purchase invalid product identifiers in swift 4swift 4 中的应用内购买无效的产品标识符
【发布时间】:2018-07-14 11:38:28
【问题描述】:

在我的应用内购买试用版中追查这个问题已经很长时间了,但我似乎无法解决这个问题。我的产品标识符一直返回为“无效的产品标识符”。希望有人指出。

@IBAction func btnRemoveAdsAction() {

    NetworkActivityIndicatorManager.NetworkOperationStarted()
    SwiftyStoreKit.purchaseProduct("ProductID", completion: {
        result in
        NetworkActivityIndicatorManager.networkOperationFinished()

            if product.needsFinishTransaction {
                SwiftyStoreKit.finishTransaction(product.transaction)
            }
            self.showAlert(alert: self.alertForPurchaseResult(result: result))
        }
    })

}

当按下按钮单击并执行上述代码时,将在方法完成时返回“结果”总是返回错误(“无效产品标识符”)并且存在于方法中。

【问题讨论】:

  • 您输入了正确的 ProductID 吗?
  • 什么是 ProductID ?您需要首先在您的应用程序下的itunes connect中为inapp Purchase创建identifire,并且您需要使用它而不是ProductID。请搜索适当的教程。
  • 是的,我输入了正确的 id 但仍然有问题

标签: swift in-app-purchase


【解决方案1】:
  1. 您的 productID 应该更像 com.myappname.funnygame.100coins。只是提到要确保这是 100% 的设置,就像在 iTunes 连接中一样。
  2. 在 iTunes 连接“协议、税务和银行业务”选项卡中完成您的付费应用协议。没有它,您每次都会收到“无效的产品标识符”。

Screenshot of Agreements, Tax and Banking in iTunes connect.

【讨论】:

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