ios – SKPaymentQueue.canMakePayments()始终返回true

ios – SKPaymentQueue.canMakePayments()始终返回true,第1张

概述重要的是要检查启用的应用内购买是否正确阻止UI,RayWenderlich博客说: Apple requires that you handle this situation gracefully; not doing so will likely result in an app rejection. 当您禁用应用程序内购买时,限制SKPaymentQueue.canMakePayments() 重要的是要检查启用的应用内购买是否正确阻止UI,RayWenderlich博客说:

Apple requires that you handle this situation gracefully; not doing so will likely result in an app rejection.

当您禁用应用程序内购买时,限制SKPaymentQueue.canMakePayments()应该返回false,但无论如何它总是返回true.我尝试了两个不同的项目,包括this one from RayWenderlich.

我只用iOS 9测试了这个.

如何识别使用父母限制禁用的应用内购买?

更新.
有人要求分享我的代码.我认为没有必要,代码很明显,没有错误.我也可以用Ray的项目重现这个问题.

// This function is called in from vIEwDIDLoad()// And after SKProduct is updated.func addTextFromProduct(p: SKProduct) {    if let Title = p.localizedTitle as String? {        self.navigationbar.topItem?.Title = Title    }    if let description = p.localizedDescription as String? {        if dailylimit {            self.informationLabel.text? = "\(waitingTime)\(description)"        } else {            self.informationLabel.text? = "\(description)"        }        if SKPaymentQueue.canMakePayments() {            unblockbuttons()        }    } else {        self.informationLabel.text? = "\(waitingTime)\(description)\n\nin-app Purchase is unavailable at this moment."        blockbuttons()    }    if SKPaymentQueue.canMakePayments() {        self.priceFormatter.locale = p.priceLocale        let localPrice: String! = self.priceFormatter.stringFromNumber(p.price)        let label = "\(localPrice)"        self.buybutton.setTitle(label,forState: UIControlState.normal)    } else {        blockbuttons()        buybutton.setTitle("Not Available",forState: UIControlState.Disabled)    }}
解决方法 我有同样的问题.也许这会对你有所帮助.
https://forums.developer.apple.com/thread/22312 我也认为这似乎是一个错误. 我用iOS 7.1.2和8.4.1测试了这个.即使“应用程序内购买”已关闭且“安装应用程序”已启用,SKPaymentQueue.canMakePayments()也会返回false. 总结

以上是内存溢出为你收集整理的ios – SKPaymentQueue.canMakePayments()始终返回true全部内容,希望文章能够帮你解决ios – SKPaymentQueue.canMakePayments()始终返回true所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/web/1028275.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存