How iOS and Android operating system push is implemented

Source: Internet
Author: User

iOS uses the technology called:APNS(Apple Push Notification Service)

Android uses the official technology called:GCM(Google clouding Messaging)

But Android's GCM is the developer's own choice can also be implemented, but iOS must go his APNs to be able.


APNs and GCM essentially exist in the system a long connection based on the TCP protocol, which keeps the connection with the server,

Keep in touch even when your phone is sleeping.

So you might have a question: Wouldn't it be a lot of electricity?

In fact, this is not the case, TCP long connection has a heartbeat time (this name is very interesting, like a human heart, we will feel

The heart keeps jumping and jumping, and it's not going to age fast? But medical research shows that the systolic and diastolic time of the heart is about 1:2, which means

Heart 2/3 of the time in the news! ), for the same reason, in a long connection, the client and the server transmit data while the data is being transmitted

No, but when there is no data transfer, the client will give the server a message every time to tell the server to keep

Contact, power consumption when sending a message, no other time. This will probably solve your question.


TCP Long connection heartbeat time, in foreign countries can be very long such as 30 minutes, in the country because the network environment complex General 10 minutes. Customer

The heartbeat, which consumes the power of the phone for a short period of time, consumes less power during the heartbeat interval. While in the heartbeat period

The client can receive and do processing when the server has push information.

ISO at the beginning of the design of the user's experience is not allowed to operate in the background, with this limitation, but for terminal equipment, application and

It is necessary for the "notice" to reach the user at any time to actively communicate with the user (typically such as a chat application). So Apple is using a

This technique. All applications, which are necessary (apply) and are allowed (users can change the settings), can be reached via APNs transit

User.



As for the Android GCM, the principle is similar, but the difference is that this is almost no use, especially in the mainland of the wall environment,

Was just dropped by pass. In general, most of the results from the XMPP specification are applied directly. If there is a small amount of IM base,

develop their own agreements. These in the realization principle and the APNS/GCM have no essential difference, but have certain technical threshold. And most generally should

To use a push, the polling method is simply implemented. Of course there are a lot of third-party push platforms, such as the Aurora Push,

Baidu's cloud push and so on. These are a service can be used together, if QQ, etc applications are unified use a push

Send the platform, then the Android push will reach the same power saving effect as iOS, BAA haha.


Off-topic: If your phone is local tyrants Apple, as long as the space enough, the application does not care about him, how much is OK. As for Android, if you think the phone is stuck, you can install less applications.











How iOS and Android operating system push is implemented

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.