iOS 应用内购买:无需提交给 Apple 即可测试真实购买

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13498005/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 21:16:27  来源:igfitidea点击:

iOS In App Purchase: test a real purchase without submitting to Apple

iossandboxad-hoc-distributionin-app-purchaseadhoc

提问by Safouane Azzabi

I implemented in app purchase in my iOS app and I want to do a real test (not a sandbox) before submitting this new version to Apple Of course, the current version of the app (in the App Store) was validated with a product So, I archived the app using an Ad Hoc distribution profile and I generated an IPA file for Ad Hoc deployment. But when I installed the app via Testflight on my device, I discovered that the app was in sandbox environment! Is there a way to do a "real" purchase before submitting the app to the App Store ?

我在我的 iOS 应用程序中实现了应用程序购买,并且我想在将这个新版本提交给 Apple 之前做一个真正的测试(不是沙箱) ,我使用 Ad Hoc 分发配置文件归档了应用程序,并为 Ad Hoc 部署生成了一个 IPA 文件。但是当我通过 Testflight 在我的设备上安装该应用程序时,我发现该应用程序处于沙盒环境中!有没有办法在将应用程序提交到 App Store 之前进行“真正的”购买?

回答by meim

You can actually test the in-app purchasing in the sandbox environment, basically you'll need to set up an test user account in your iTunesConnect.

您实际上可以在沙盒环境中测试应用内购买,基本上您需要在 iTunesConnect 中设置一个测试用户帐户。

Check the apple documentation here: http://developer.apple.com/library/ios/#technotes/tn2259/_index.html

在此处查看苹果文档:http: //developer.apple.com/library/ios/#technotes/tn2259/_index.html

You'll be able to find all the information related to In-App Purchasing, including sandbox testing.

您将能够找到与应用内购买相关的所有信息,包括沙盒测试。

回答by delrox

Short answer: you can't test a real purchase (aka, spend real money). It isn't possible.

简短回答:您无法测试真正的购买(也就是花真钱)。这是不可能的。

Slightly longer answer: You'll automatically hit the sandbox environment unless it's an apple-signed release build. Even ad-hoc signed builds hit the sandbox.

稍微长一点的答案:除非它是苹果签名的发布版本,否则您将自动进入沙箱环境。即使是临时签名的构建也会遇到沙箱。

To test a new IAP: create your IAP (it will be in "needs approval mode" until submitted with the final build and test against the sandbox - that's fine). If your purchase works against the sandbox, it should work against prod with real money as well. It would be great to do a trial run with real money, but that's just not possible until the IAP is approved and you get the production signed version of the app from the app store.

要测试新的 IAP:创建您的 IAP(它将处于“需要批准模式”,直到与最终构建一起提交并针对沙箱进行测试 - 这很好)。如果您的购买适用于沙盒,它也应该适用于使用真钱的产品。用真钱进行试运行会很棒,但是在 IAP 获得批准并且您从应用商店获得应用的生产签名版本之前,这是不可能的。

回答by nits

Just create a test account on iTunes Connect. Then log out from the device and run your app from Xcode.

只需在 iTunes Connect 上创建一个测试帐户。然后从设备注销并从 Xcode 运行您的应用程序。

回答by ACP

To get access to the purchase you need apple signature, because you are connecting with the apple servers.

要访问购买,您需要苹果签名,因为您正在连接苹果服务器。

I assume that your app, is doesnt have that signature, so your request goes to the sandbox.

我假设您的应用程序没有该签名,因此您的请求会发送到沙箱。