Iphone


The iPhone's notification push is "system-level", independent of APP is the communication between the device and the Apple server, not just the peer-to-peer between the device and the service provider.

Iphone

For example, Facebook's server sends a message to Apple's corresponding server, and it then "transfer" to your device. When you receive the notification, open the app and start receiving data from the FB server. Although it is the same as the notification you saw before, but it comes through two different channels.
Iphone


iOS can't launch a lot of background Apps at the same time, but can still receive pushes stably and quickly. Why? Just because it simplifies the communication process of the device itself, it only needs one port to communicate with Apple's own server, instead of the different ports of each application like Android, so the iPhone can be completed with small memory.



Android's push method is more like a "computer system." Each APP that needs to be pushed in the background has its own separate background process to communicate with its own server to exchange data.

(Similar to Apple Push Notification service, Android also has Google Cloud Message, but it is blocked by mainland China.)

Iphone


This is actually a technical matter involving the design principles of both iOS and Android operating systems.

This problem is more obvious in mainland China. In mainland China, we add more memory to the Android phone because we couldn't connect to the Google server.

In the "Huawei P30" sold worldwide, the 128G hard drive model is only equipped with 4G or 6G RAM;
while the Chinese version of the P30, 64G hard drive model is equipped with 8G RAM!
In mainland China, you can hardly find an Android machine with 128G hard drive and 4G memory, but at least 8G. At first glance, it seems that the Chinese got a bargain deal? In fact, this is a helpless move of the domestic Android ecosystem in mainland China.

Iphone


In Android, every APP must leave some threads in the background (that is, RAM), ready to receive incoming information. In other words, when you just turned on your phone and haven't started using them yet, some of the threads on all the apps on your phone have been quietly launched and put into memory.

Iphone


These background-initiated threads cannot be closed because they are "legal". If they are closed, the user will not receive the message in time. Also, do not underestimate the number of these background threads, an APP in the background to take a dozen or twenty MB is really not much, but 100 APP (64G hard drive mobile phone can hold 100 APP) add up to eat nearly 2G Memory!

Iphone


Why do Chinese Android machines have large RAM? To give an example, we often use the WeChat app: First, after you open the WeChat login account, the WeChat app on your mobile phone will maintain a "long-term connection" with Tencent's server.

Iphone


When you send a message to your friend, this message is not sent directly from your mobile phone to his mobile phone, but your mobile phone sends the message to Tencent's server, then Tencent's server sends it to your friend.

Iphone


Here is a problem. If the WeChat app on her mobile phone is turned off, even if the Tencent server sends the message, she will not receive it because the WeChat app on her mobile phone has been completely closed, which disconnected from the Tencent server.

Iphone


Only when she opens WeChat again, its connection is restored and she can receive the message. If you want to receive the message in time, then the WeChat app shouldn't be completely closed. It needs to leave some threads, keep running in the background, and keep connected with Tencent's server, so that once the message is received, the system can promptly launch the "notification push mechanism" to remind you.

Ram management


Therefore, the memory capacity of the Android machine must be increased with the capacity of the hard disk. The larger the hard disk capacity, the more APPs can be installed, and the more memory is needed to ensure that the threads left by the APP in the background operate normally.

Let's talk about iOS, why doesn't it need a big memory? Because Apple has its own server. This system of iOS must be paired with "Apple's Server" to run properly. Whenever an iOS device is connected to the Internet, the iOS system first establishes a Keep-Alive with Apple's server.

Ram management


On iOS, if WeChat is open, then the logic is the same as the above Android, the difference is reflected after WeChat is close.

Ram management


If the WeChat app on your iPhone is closed, it will be disconnected from Tencent's server:

1. Your friend sent a message to you, this message was first sent to Tencent's server.

2. Tencent server found that "WeChat APP on your mobile phone does not establish a connection with the server",

3. then it will turn this message to Apple's server.

4. Then Apple's server will send it to your iOS system after receiving it, and the system will be able to make a notice in time.

Ram management


It actually has only one extra step, but the benefit is that "WeChat app on your phone can be completely closed", there is no need to leave extra threads to receive messages, because Apple's server will always "keep receiving messages" and send the message to iOS, and then push notifications to you.

In this way, the memory of the iPhone does not need to be increased along with the increase of hard disk capacity, because even if the APP is completely closed, it does not affect the timely reception of the notification. Also, iOS does not actually support a "real sense of background running". In the background, it only supports a limited kind of operations such as listening to songs, downloading, and navigation.

If an APP enters the background and has not been transferred to the foreground within 10 minutes, the system will close it, leaving only "a screenshot before its death". This is the so-called "tombstone mechanism." Therefore, most of the iPhone's memory is only for this current APP service, so that an APP uses 4G memory, it is really "more than enough".

Note: Why do we all say that the iPhone phone is secure and privacy-oriented?

For the same reason, if the APP on the iPhone is closed, indeed, all threads are really closed.
But for Android, because every APP must "leave some threads in the background has been running", some unscrupulous APP or even mobile phone manufacturers, not only will leave the thread to receive messages but also leave a thread to sneak open the camera or microphone to collect user data. These background threads, because they are "system code level things", users are not likely to close them.

Ram management


If your Android phone can use Google's Serve, then you don't need such a large amount of memory. Because of the use of Google's server, its "notification Pushing Mechanism" has become the same as iOS, there is no need to have the APP's own thread left in the background, Google's server will help the APPs to receive information.

Ram management


But because GFW, Android users in mainland China can not connect to "Google's server", then, to let Apps receive the message in time, developers can only use the method that "constantly lurking and working in the background". To let the APP thread stay in the background, need a lot of memory support, then the Android machine has to increase memory. So, who will pay for this extra memory? The wool still comes from the sheep's back. Of course, their users, or consumers have paid. This is the most miserable part of Android users in mainland China. They not only have to endure the disclosure of privacy but also pay for such price.

Ram management


At present, "APPs stay in the background" has already fouled the entire "Android Ecology" in mainland China pandemonium and messy.

Give me your feedback keep supporting.