IOS Text below Status Bar while app is in Backgrou

2020-04-21 06:49发布

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?

1条回答
再贱就再见
2楼-- · 2020-04-21 07:16

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.

查看更多
登录 后发表回答