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/