如何使用苹果推送通知沙箱作为虚拟设备?

发布于 2024-08-06 22:03:01 字数 384 浏览 4 评论 0 原文

Apple 的 APN 服务编程指南,位于 配置和开发部分声称“沙盒环境还充当虚拟设备,支持模拟端到端测试。”但是,我找不到如何访问此虚拟设备的任何信息(例如,如何获取设备令牌、如何检查发送的通知的状态等)有谁知道此信息是否有效以及是否有效如何使用沙箱作为虚拟设备进行端到端测试?

Apple's APN Service Programming Guide in the Provisioning and Development section claims that "[t]he sandbox environment also acts a virtual device, enabling simulated end-to-end testing." However I couldn't find any information how this virtual device can be accessed (e.g. how do you get a device token, how do you check the status of notifications sent, etc.) Does anyone know if this information is valid and if it is how does one go about doing end-to-end testing using the sandbox as a virtual device?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

黎歌 2024-08-13 22:03:01

获取设备令牌在沙箱服务器中的工作方式与在生产服务器中的工作方式相同 - 您只需获取一个开发设备令牌,该令牌只能在与其沙箱服务器通信时使用。但是,就像生产服务器一样,您无法检查发送的通知的状态或类似的内容。

“虚拟设备”的措辞令人困惑,因为它实际上只是一组单独的基础设施,仅与开发应用程序/设备令牌通信。

因此,只需在开发应用程序时(即,当您的应用程序是使用开发配置文件构建时)与开发服务器通信,并在应用程序以临时或生产模式构建时与生产服务器通信即可。该过程将是相同的。

但是,请确保不要混合开发设备令牌和生产设备令牌。

此外,推送通知在模拟器中不起作用,因此您需要在实际设备上进行测试。如果您在 iPod Touch 上进行测试,请务必记住,如果背光关闭,它只会每十五分钟左右检查一次消息。

希望这有帮助!

Getting a device token works the same in sandbox servers as it does in production servers - you just get a development device token that can only be used when talking to their sandbox servers. However, just like the production servers, you can't check the status of notifications sent or anything like that.

The "virtual device" wording is confusing, because it's really just a separate set of infrastructure that only talks to development applications/device tokens.

So, just talk to the development servers while you're developing your app (that is, when your app is built with a development provisioning profile) and talk to production servers when the app is built in ad-hoc or production mode. The process is going to be same.

However, be sure not to mix development device tokens and production device tokens.

Also, push notifications don't work in the simulator, so you will need an actual device to test on. If you're testing on an iPod Touch, be sure to keep in mind that it will only check for messages every fifteen minutes or so if the backlight is off.

Hope this helps!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文