iphone - Apple 推送通知服务使用 UDP 还是 TCP?

标签 iphone

Apple 推送是否使用 TCP 或 UDP 将消息从其服务器传送到设备?

最佳答案

来自 Apple Push Notification Service Programming Guide :

Important: WiFi is used for push notifications only if there is no cellular connection or if the device is an iPod touch. To receive notifications via Wi-Fi, the device’s display must be on (that is, it cannot be sleeping) or it must be plugged in. The WiFi transmitter must be on outbound TCP port 5223 and must be within effective range.

还有:

Sandbox and Production Environments

To develop and deploy the provider side of a client-server application, you must get SSL certificates from the iPhone Developer Program portal. Each certificate is limited to a single application, identified by its bundle ID. Each certificate is also limited to one of two development environments, each with its own assigned IP address:

Sandbox: The sandbox environment is used for initial development and testing of the provider application. It provides the same set of services as the production environment, although with a smaller number of server units. The sandbox environment also acts a virtual device, enabling simulated end-to-end testing. You access the sandbox environment at gateway.sandbox.push.apple.com, outbound TCP port 2195.

Production: Use the production environment when building the production version of the provider application. Applications using the production environment must meet Apple’s reliability requirements. You access the production environment at gateway.push.apple.com, outbound TCP port 2195.

最后:

General Provider Requirements

As a provider you may communicate with Apple Push Notification Service over a binary interface. This interface is a high-speed, high-capacity interface for providers; it uses a streaming TCP socket design in conjunction with binary content. The binary interface is asynchronous.

The binary interface of the production environment is available through gateway.push.apple.com, port 2195; the binary interface of the sandbox (development) environment is available through gateway.sandbox.push.apple.com, port 2195. You may establish multiple, parallel connections to the same gateway or to multiple gateway instances.

关于iphone - Apple 推送通知服务使用 UDP 还是 TCP?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2520567/

相关文章:

iphone - 从 iPhone sdk 进行电话 session

iphone - 如何在 iPhone 的 UIbutton 中限制属性的访问?

iphone - 从 plist 中读取 BOOL,用新值覆盖它

ios - UITabBar setTintColor 在 [_window setRootViewController] 之后不起作用

iphone - iphone 应用程序中的日期选择器

html - 如何使 iFrame 在 iPhone 6 中响应?

iphone - 将已发布的 iPhone/iPad 应用程序转换为通用

iphone - 特定部分的 UITableView allowsSelection 属性

ios - 如何检查 NSDocumentDirectory 中是否存在数据

iphone - 在任何操作系统上运行不同格式的可执行文件