1

I'm trying to figure out how to implement a banner like notification with text below the statusbar while an app is in the background.

Much like Runkeeper, while active and app is in background:

enter image description here

Is it a Banner? All I can find for that is banners for ads while the app is in the foreground.

Do I need to customize the StatusBar and add an extra view for the StatusBar with a custom text to appear?

Is it a customized UILocalNotification to be continuously shown?

Doro
  • 2,413
  • 2
  • 14
  • 26
Deukalion
  • 2,516
  • 9
  • 32
  • 50

1 Answers1

5

This banner is displayed by iOS itself in the following situations:

  • A background app is tracking your position (after a startUpdatingLocation)
  • A background app is using your microphone
  • A background app is performing a VOIP call

The banner color changes with the reason.
There is no way to force iOS to display those banners but by using one of the relevant background modes.

Quentin Hayot
  • 7,786
  • 6
  • 45
  • 62
  • Then if this is true, why does it not appear with an app with background tracking? – Deukalion Sep 17 '15 at 12:53
  • 2
    You confuse "background tracking" with "Permanent location updates". The first one only works when your app is active (foreground or in background with a tracking session initiated in foreground). The second one needs the 'requestAlwaysAuthorization' and will give updates to your app all the time, even if the app is not even started. The first one is a short-time event, the second one is permanent (and will only show the GPS tracking icon in the status bar). – Quentin Hayot Sep 17 '15 at 12:59