Today read an article about the Apple system to receive push messages, simply record
Push systems also have a test environment (sandbox environment) and a formal environment
Apple Push Service
For Apple's IOS system, it has its own official push service APNS (Apple push Notification services). When our phone is powered on, a push service built into the IOS system is running and stays connected to the APNS server for a long time to receive push messages from the APNS server.
When we send a push message to the APNS server, the APNS server pushes the message to the corresponding device. When the corresponding IOS device receives the push message, it passes the message to the corresponding APP processing
DevicetokenDevicetoken is bundled with devices and apps. The same application of different devices, their devicetoken is different. Different applications of the same device, their devicetoken are also different. Do you remember that every time we installed an application, it will pop up a "will you allow XXX to send you system messages" prompt? When you click "Allow", your phone will request a devicetoken to the APNS server, and the APNS server will link the Devicetoken to this iOS. Unless you uninstall the app, the Devicetoken has been bundled with your device and the app.the process of Apple pushFirst, when we launch the app popup to allow "system notification" request, after we click Allow, IOS device requests a devicetoken to the APNS server. At this point, the APNS server binds the Devicetoken to the IOS device. Second, when we need to send a push message, we ask our backend server to tell it that we want to send a push message to a devicetoken. The background server receives the message and instead requests the APNS server's sandbox environment interface or the on-line environment interface. In the third step, when the APNS server receives the request, it takes out the long connection established with the IOS based on Devicetoken and finally outputs the content to be sent to that long connection. Fourth step, with the APNS server to establish a long-connected IOS device received the message, analyze the Devicetoken belongs to which app, and distribute it to the corresponding app for processing. The whole process is like this one, as described in the following diagram:
Apple Push Process