gpt4 book ai didi

iOS:如何检查是否启用了应用内购买?

转载 作者:可可西里 更新时间:2023-11-01 04:38:43 26 4
gpt4 key购买 nike

有一些函数可以检查用户是否启用了某些功能。就像位置或相机胶卷一样。

但是,如何检查是否启用了应用内购买?

最佳答案

这可能对你有帮助:

swift

if SKPaymentQueue.canMakePayments() {

// you can, so start adding the payment to the payment queue
} else {

// you may not, handle the rejection
}

对象

if ([SKPaymentQueue canMakePayments]) {

// you can, so start adding the payment to the payment queue
} else {

// you may not, handle the rejection
}

它来自 SKPaymentQueue关于canMakePayments()类方法的类引用:

true if the user is allowed to authorize payment. false if they do not have permission.

以及对同一方法的进一步解释:

An iPhone can be restricted from accessing the Apple App Store. For example, parents can restrict their children’s ability to purchase additional content. Your application should confirm that the user is allowed to authorize payments before adding a payment to the queue. Your application may also want to alter its behavior or appearance when the user is not allowed to authorize payments.

关于iOS:如何检查是否启用了应用内购买?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25447513/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com