Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Neblinio

macrumors member
Original poster
Sep 27, 2007
35
40
I understand how background execution works on iOS, but I've always wondered how Background App Refresh toggles really work in iOS Settings.

First things first: What's needed for an App to be shown in Background App Refresh list in Settings?

Obviously, Apps that have "fetch" present in their "UIBackgroundModes" are listed there. It makes sense. But also Apps having "remote-notification" seem to be present. Examples: PayPal (remote-notification) and Telegram Messenger (audio, remote-notification).
Please correct me if I'm wrong or if I miss something.

Here comes the problem: try disabling Background App Refresh for Telegram and have someone message you while the App is not running in the foreground.
What happens? A remote push notification wakes Telegram and it downloads your message in the background.
So what have you achieved by disabling its Background App Refresh toggle? Remember Telegram only uses "audio" and "remote-notification" background modes.
 

ashindnile

macrumors 6502
Jul 16, 2015
385
156
A remote push notification does not download the message in its entirety..
And by this I mean the images sent aren't necessarily downloaded entirely for example..
With push notifications, you get notified about particular events. Take the case of Facebook.
You get notified if say someone comments on a post you make.
However background app refresh downloads data and keeps your newsfeed up to date with the latest content.
Push just sends enough data for the user to know there's something new.
Even in push mail you'll observe that while you receive the email threads, they still have to download before you can view them.
Hope I made sense!
 

Neblinio

macrumors member
Original poster
Sep 27, 2007
35
40
Thanks for replying and giving some good examples.
I had already noticed the difference you highlight: remote push notifications only download basic content such as plain text.
But one question remains: considering the example App Telegram only uses "remote-notification" and not "fetch", what's changed when you toggle Background App Refresh on/off for it? I really can't see a difference.
(In fact, I don't even know why it's listed there)
 

ashindnile

macrumors 6502
Jul 16, 2015
385
156
If you've got background app refresh turned ON, incoming messages are periodically fetched and your messages will be waiting for you. When it's off you'll observe that your threads update after the app launches..
 

Neblinio

macrumors member
Original poster
Sep 27, 2007
35
40
The problem is Telegram still manages to download the messages in the background with Background App Refresh turned off.

I've just tested it: with Telegram in a suspended state and BAR turned off, I received a message, enabled airplane mode and opened Telegram. The message was there.

I really don't know why, but BAR toggle has no effect in this case.
 

GreyOS

macrumors 68040
Apr 12, 2012
3,358
1,694
I reproduced this using your method but only when I had just been using Telegram. So I suspect it's still running for a little bit when backgrounded- not in a background refresh kind of way but in the old style 'you get a short while to wind down' way.

I couldn't reproduce when it had been a while since using Telegram- messages did not appear
 

GreyOS

macrumors 68040
Apr 12, 2012
3,358
1,694
And ashindnile gives some wrong information

The background mode remote-notification does mean that the whole message is downloaded when the notification is received, see the table here

https://developer.apple.com/library.../BackgroundExecution/BackgroundExecution.html

Now I'm pretty sure that background mode is disabled by the BAR setting (so that's why telegram appears in the list). I honestly just think that Telegram is downloading the message not through that disabled background mode but because it's still partly running, as i suggested earlier?
 

bushido

Suspended
Mar 26, 2008
8,070
2,755
Germany
I enabled it on some apps for the first time in like two years the other day and I can't tell a difference.

Like when I open twitter it still takes a bit to refresh, same as before. Don't see any difference on Snapchat and Instagram either. It still refreshes content only after I open the apps again.

Probably gonna disable it again soon. See no point in it, no reason to waste battery
 

ashindnile

macrumors 6502
Jul 16, 2015
385
156
I enabled it on some apps for the first time in like two years the other day and I can't tell a difference.

Like when I open twitter it still takes a bit to refresh, same as before. Don't see any difference on Snapchat and Instagram either. It still refreshes content only after I open the apps again.

Probably gonna disable it again soon. See no point in it, no reason to waste battery
The refreshing is done periodically..
Maybe that's why it wasn't up to date..
 

cynics

macrumors G4
Jan 8, 2012
11,959
2,156
I enabled it on some apps for the first time in like two years the other day and I can't tell a difference.

Like when I open twitter it still takes a bit to refresh, same as before. Don't see any difference on Snapchat and Instagram either. It still refreshes content only after I open the apps again.

Probably gonna disable it again soon. See no point in it, no reason to waste battery

The biggest difference I notice is with MyFitnessPal (calorie counting app). It will record steps from the phone, when I have BAR off and launch the app on my iPad those steps recorded with my iPhone won't show up until I open the app on the iPhone and let it sync the data. With BAR turned on it will sync that data (steps) from my iPhone without me doing anything.

My best battery life I've ever had was with BAR on. I'm not saying it helped battery life just I couldn't notice any/much negative effect from using it.
 

fjarl

macrumors member
Sep 13, 2015
84
94
My best battery life I've ever had was with BAR on. I'm not saying it helped battery life just I couldn't notice any/much negative effect from using it.

My understanding is that it could help a little bit. Most people seem to think of BAR as this evil battery hog that constantly wakes your phone to download content. But it is also pretty smart as I understand it, for example downloading stuff when another app has activated wifi, updating gps when another app accesses positional data etc. Basically getting the most out of those situations where power draining features are being used anyway. This might explain people not really seeing an improvement in battery life with BAR on.
 

Neblinio

macrumors member
Original poster
Sep 27, 2007
35
40
I reproduced this using your method but only when I had just been using Telegram. So I suspect it's still running for a little bit when backgrounded- not in a background refresh kind of way but in the old style 'you get a short while to wind down' way.

I couldn't reproduce when it had been a while since using Telegram- messages did not appear
You're right. New messages are still downloaded for a brief amount of time, but then stop (unlike that famous competitor App now owned by Facebook, which abuses PushKit so it can never be prevented from downloading messages in the background).

I'll have to do more tests with the help of a syslog viewer, to try to learn how much time it keeps running in the background.
 
  • Like
Reactions: GreyOS

GreyOS

macrumors 68040
Apr 12, 2012
3,358
1,694
You're right. New messages are still downloaded for a brief amount of time, but then stop (unlike that famous competitor App now owned by Facebook, which abuses PushKit so it can never be prevented from downloading messages in the background).

I'll have to do more tests with the help of a syslog viewer, to try to learn how much time it keeps running in the background.
Ah so Pushkit is also how that other app manages to support the web client then..

Btw how did you find out what background modes apps declare?
 

Neblinio

macrumors member
Original poster
Sep 27, 2007
35
40
Ah so Pushkit is also how that other app manages to support the web client then..

Btw how did you find out what background modes apps declare?
It's really simple. Download the app through iTunes, open the ipa file (it's just a renamed zip file) and find info.plist
 
  • Like
Reactions: makr and GreyOS
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.