Mac App Store 收据验证,用于测试:我从未收到过收据
我一直在努力使用苹果的代码和互联网上的一些指南来完成收据验证。至此,我已经成功签署了代码,并开始验证收据。此时,如果您不熟悉 Apple 文档的这一部分,将会很有帮助:
当我在XCode,应用程序按预期退出并显示代码 173(没有要验证的收据)。当我在 XCode 之外启动应用程序(在查找器中双击)时,应用程序会立即启动,然后关闭,并弹出一个登录对话框(如预期)。我已在 iTunes Connect 中创建了一个测试帐户,并使用此帐户登录。点击登录按钮后,进度指示器会旋转几秒钟,然后登录框就会消失。据我所知,此后什么也没有发生。据我了解,应用程序商店此时应该自动生成/提取收据并启动应用程序,但事实并非如此。
我尝试更好地观察应用程序启动过程。我在收据检查过程的每个点都放入了一些 printf ,但我不知道这些将打印在哪里。 (使用“打开”在终端中启动应用程序根本不显示任何输出。)我尝试使用 NSRunAlertPanel 生成对话框,但我认为当收据检查发生时,没有加载足够的应用程序他们正确地出现。
此时,由于无法真正观察正在发生的情况,我不确定如何进一步调试问题。
I've been fighting my way through receipt validation using Apple's code and a few guides on the internet. At this point, I've managed to sign the code, and start to validate to validate the receipt. At this point, it would be helpful to see this part of the Apple's documentation if you're not familiar with it:
Validating App Store Receipts # Validate during development process
When I launch the app within XCode, the app exits with code 173 as expected (there isn't a receipt to validate). When I launch the app outside of XCode (double click in finder), the app launches for a split second, closes, and a login dialog pops up (as expected). I've created a test account in iTunes Connect, and log in with this account. Once hitting the login button, a progress indicator spins for a couple of seconds and then the login box disappears. Nothing happens after this as far as I can tell. As I understand things, the App Store should automatically generate / pull a receipt and launch the application at this point, but it doesn't.
I've tried to observe the application launch process a bit better. I put in some printf's at each point of the receipt checking process, but I can't figure out where these would be printed. (Launching the app in the terminal using 'open' doesn't show any output at all.) I've tried using NSRunAlertPanel to generate dialog boxes, but I don't think enough of the app is loaded when the receipt checking occurs for them to come up properly.
At this point, I'm not sure how to debug the problem further due to not being able to really observe what's going on.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查您是否已在 iTunes Connect 中设置应用程序(您需要输入详细信息,无需提交二进制文件)。
*最初取自blog.pado.name/post/3008648963/app-store-receipt-validation-oddness,现在是404
Check that you have set up the app in iTunes Connect (you need to enter the details, you don't have to submit a binary).
*Originally taken from blog.pado.name/post/3008648963/app-store-receipt-validation-oddness, which is now a 404
如果您想节省大量时间来开发收据检查代码,我强烈推荐 Receigen 。 (不,我不是这个工具的开发人员,但我更喜欢添加功能,并且不会重复其他人所做的出色工作。)
确保您使用开发证书签署了应用程序,以便使用添加的测试人员在 iTunes Connect 中。
If you want to save a lot of time developing receipt checking code I highly recommend Receigen. (No, I'm not the developer of this tool but I prefer to add features and don't repeat what others have done in a great way.)
Make sure you signed the application with the development certificate in order to use the tester added in iTunes Connect.