Similarities:
Implementation ideas.
Your Server communicates with Apple (apns) or Google push server. The push server sends push information to the corresponding terminal device based on the corresponding conditions (for example, the current terminal is online.
The terminal device informs the push server of my existence through a self-identification mechanism, and sends the push server an ID returned to the terminal to its own server. When the push server needs to be pushed, to communicate with apple or android push server, send the ID information.
Differences:
Device identity determination
Apple
Each device has a unique device certificate, and apns also has a server certificate. When the two are created, check the certificate validity..
The push authentication check is divided into two layers:
1. TLS encrypted connection
If the TLS connection is successful, the device certificate is sent to apns, and a TLS handshake is performed every 15 minutes. If the handshake fails, the connection will continue.
2. Token Authentication
After the TLS connection is successful, the device token of each device is calculated through the device certificate and key, and then the device token is sent to the terminal device to determine the unique identity of the device.
Android
You need to register a Gmail mailbox and use the Gmail mailbox to determine the terminal device.