SKPaymentQueue addTransactionObserver 在应用内购买后在启动时要求输入 App Store 密码 [英] SKPaymentQueue addTransactionObserver asking for App Store password on startup after in-app purchase

查看:24
本文介绍了SKPaymentQueue addTransactionObserver 在应用内购买后在启动时要求输入 App Store 密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用正在使用应用内购买,我的大多数用户都可以正常购买,没有任何问题.对于这些人,我的应用会在购买成功后下载内容,他们很高兴.

My app is using in-app purchases, and most of my users can purchase just fine without any problems. For these folks, my app downloads the content after the purchase succeeds and they are happy.

然而,对于我的越来越多的用户来说,一旦他们成功完成应用内购买,每次应用启动时都会要求他们提供他们的 App Store 密码.我相信这是在调用以下内容时发生的:

However, for a growing number of my users, once they complete a successful in-app purchase they are being asked for their App Store password every time the app starts up after that. I believe this is happening on the call to:

[[SKPaymentQueue defaultQueue] addTransactionObserver:observer];

我根据 Apple 的应用内购买指南中的第 6 步在启动时调用它:

which I am calling on startup in accordance with step 6 in Apple's in-app purchase guide:

我的猜测是,出于某种原因,Apple 的应用内购买服务器没有注册交易成功完成 - 即使我打电话

My guess is that, for some reason, Apple's in-app purchase servers aren't registering that the transaction finished successfully - even though I call

[[SKPaymentQueue defaultQueue] finishTransaction:transaction];

交易完成且我的内容已成功下载时.

when the transaction is completed and my content has been successfully downloaded.

2 个问题:

  1. 还有人看到这个吗?

  1. Is anyone else seeing this?

有人有修复建议吗?

赏金编辑:

这是一个使用不同 Apple-ID 进行的交易.这就是为什么除非您在对话框中输入正确的凭据,否则它无法完成.问题应该是:

Its a transaction which was made with a different Apple-ID. Thats why it cannot be finished unless you type in the right credentials into the dialog. The Question should be either:

  1. 如何防止此类死交易(交易未完成,用户无网络,同时更改 App-ID)?
  2. 如何修剪 SkPaymentQueue?

推荐答案

我遇到了同样的问题.请确保您致电

I had the same problem.make sure that you call

[[SKPaymentQueue defaultQueue] finishTransaction:transaction]; 

对于交易的所有三个状态:SKPaymentTransactionStatePurchased、SKPaymentTransactionStateRestored、SKPaymentTransactionStateFailed.

for all three states of the transactions: SKPaymentTransactionStatePurchased, SKPaymentTransactionStateRestored, SKPaymentTransactionStateFailed.

这篇关于SKPaymentQueue addTransactionObserver 在应用内购买后在启动时要求输入 App Store 密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆