如何在SkpaymentTransActionObserver中退还了如何检测到不清楚的应用内项目?
我正在使用本地Storekit进行测试,用于不可消耗的应用内物品。
如果我购买了不可消耗的应用程序内商品,则可以在skpaymentTransactionObserver 中收到回调,
extension IAPHelper: SKPaymentTransactionObserver {
public func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
for transaction in transactions {
switch transaction.transactionState {
case .purchased:
complete(transaction)
...
}
}
private func complete(_ transaction: SKPaymentTransaction) {
print("complete...")
// Save purchase record to disk to indicate user owns this non-consumable item.
persistPurchase(identifier: transaction.payment.productIdentifier)
SKPaymentQueue.default().finishTransaction(transaction)
}
如果我去debug/ storekit/ manage transactions ...在skpaymentTransactionObserver
中。
即使我关闭了应用程序并再次启动应用程序,也没有任何回调skpaymentTransactionObserver
,以指示已退还了不可消耗的应用程序内项目,因此我可以阻止用户访问用户应用内项目。
我可以知道吗,是否可以在skpaymentTransActionObserver
中退款,是否可以检测到不需要的应用内项目?如果不是,那么正确的方法是什么?
I am testing using local StoreKit, for non consumable in-app item.
If I purchase the non consumable in-app item, I can receive callback in SKPaymentTransactionObserver
without issue
extension IAPHelper: SKPaymentTransactionObserver {
public func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
for transaction in transactions {
switch transaction.transactionState {
case .purchased:
complete(transaction)
...
}
}
private func complete(_ transaction: SKPaymentTransaction) {
print("complete...")
// Save purchase record to disk to indicate user owns this non-consumable item.
persistPurchase(identifier: transaction.payment.productIdentifier)
SKPaymentQueue.default().finishTransaction(transaction)
}
If I go to Debug/ StoreKit/ Manage Transactions... , to perform refund, I do not receive any callback in SKPaymentTransactionObserver
.
Even if I close the app and start the app again, there isn't any callback to SKPaymentTransactionObserver
, to indicate the non consumable in-app item has been refunded, so that I can block user from accessing the in-app item.
May I know, is it possible to detect a non-consumable in-app item has been refunded, in SKPaymentTransactionObserver
? If not, what is the right way to do so?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论