Skull One
iPF Novice
- Joined
- Mar 7, 2012
- Messages
- 612
- Reaction score
- 78
He was being very sure of the iOS stuff. As long as he hasn't invented it, he doesn't know everything for sure, neither do I.
Klevis, IT Engineering, Tirana, AL
Actually I do know for sure. And now I am going to take a few minutes to explain why things work the way the do. You might want to re-read this several times. Because if you are going to school for IT Engineering, you are going to actually need to know and be able to explain this before you graduate. Well if your university is any good that is.
TCP/IP is the networking protocol used by iOS and Android. They chose this standard because that is how the Internet has been running since the early 1980s. At present iOS has to default to IPv4 because all cellular networks are currently still on that technology. So with that out of the way, lets look at how things work.
There are two ways to implement Push Notifications properly. There is a third way but it is too idiotic and battery intensive to spend time typing it up.
1) Run a piece of software 24/7 that monitors one or more IP addresses and wait for a connection request from another IP address.
2) Run a piece of software 24/7 that connects to another IP address and keeps one or more port open to that server.
Now you can't use UDP packets to handle this because UDP is a lossy protocol. IE you can drop one or more UDP packets and not be required to retransmit them. Well if one of those packets was a notification, then you just missed it. And ICMP, the third major protocol used on TCP/IP connection, is all about error status or checking status, so that rules that out. So with that in mind we can logically deduce that the connection must be TCP.
Now under scenario one the CPU would have to be in a non-sleep state for the software to work. Simply put this would waste a ton of battery life. Since Apple only uses sub 1500 mHa batteries to power iPhones, they have to be really careful about battery usage. The great news to this is, that means iPads get a boost in power conversation because of it to help power the screen.
So that leaves us with scenario two. And that happens to be the one Apple chose to implement because of its battery saving nature. So iOS (and Android) has a notification daemon that makes one or more TCP/IP connections to one or more IP addresses and opens one or more TCP ports to those servers. This then allows the software to set a hardware interrupt on either the WiFi or Cellular radio to awaken the application when the device gets an incoming TCP packet to one of the TCP ports the programming is monitoring. Simple and very battery efficient.
That means whether there are one or one billion applications set up with notifications, the same amount of power is required to maintain the Push Notification system.
Now if you really want to save battery life, when it comes to Notifications, you only have to make ONE ITTY BITTY change to the notifications system. Simply turn off Notifications from showing on the lock screen. Because THAT is what can eat the battery life if you get a lot of notifications. Because every time you get a notification it turns the display on for 15 seconds, well unless you have a magnetic cover and have the lock screen feature set to use it.
So now you know how things work and WHY they work the way they do. And as a side note, you can actually RESEARCH EVERYTHING I have typed here to verify it for yourself.
Good luck with your career path if you decide to stay in IT Engineering. It isn't an easy one because it requires you to learn a lot of information.