refreshReceipt是否要求AppStore凭据? [英] Does refreshReceipt ask for AppStore credentials?

查看:158
本文介绍了refreshReceipt是否要求AppStore凭据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在一个示例应用程序中测试了iOS的In App Purchases.我需要弄清楚是否可以在启动时立即调用refreshReceipt API,以检查用户是否有资格使用某些试用期订阅等.

I have been testing In App Purchases for iOS in a sample app. I need to figure out if I can call refreshReceipt API immediately at the launch to check user's eligibility for some trial period subscriptions etc.

我在AppDelegate的application:didFinishLaunching:options方法中调用了refreshReceipt,但它要求我提供AppStore凭据,基本上是沙盒用户的密码.我没有从Apple文档中读取到这种行为.是由于沙箱环境而发生的事情还是在生产环境中发生的事情.

I have called refreshReceipt in AppDelegate's application:didFinishLaunching:options method but it asks me for AppStore credentials, basically the Sandbox user's password. I was not expecting this behaviour as read from Apple docs. Is it something that is happening because of the sandbox environment or does it happen in Production environment as well.

此外,Restore Purchase是否触发AppStore登录警报.苹果文档说可以,但是最近我选择了该选项时,发现手机上的音乐应用程序之一没有要求提供凭据.可能是他们没有调用StoreKit的restorePurchase API,而是使用了自己的机制.

Also, does Restore Purchase trigger the AppStore login alert. Apple docs say it does, but recently I saw one of the music apps on my phone did not ask for credentials when I opted the option. It may be that they are not calling the StoreKit's restorePurchase API, rather using their own mechanism.

推荐答案

只要设备上不存在收据,您都会收到登录提示.在沙盒中,没有安装收据,因此您总是会看到弹出窗口.您还应该注意,除非您进行了购买,否则在沙箱中刷新收据后,收据仍然不存在.

You'll receive the login prompt whenever the receipt isn't present on the device. In sandbox, there are no installation receipts so you're always seeing the popup. You should also notice that the receipt still doesn't exist after it's refreshed in sandbox unless you made a purchase.

如果用户登录到其iTunes帐户,则收据应该始终在生产中.

If the user is logged in to their iTunes account, a receipt should always be there in production.

对于恢复,我认为它遵循相同的逻辑(如果没有收据,则要求提示),但这与Apple所说的相矛盾.

For restores, I would assume it follows this same logic (asks for prompt if receipt isn't present) but this contradicts what Apple says.

这篇关于refreshReceipt是否要求AppStore凭据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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