matt--- matt--- - 1 year ago 83
iOS Question

iOS: Apple logo + Restart screen after Force Quit

Some of the iOS users of my app (one with an iPhone 6 with iOS 9.3.2) report that upon Force Quitting the app, they will see a black screen with only the Apple logo and a restart bar, and their device will restart. My own devices do not reproduce this and I do not receive any crash reports, so I've been unable to track this issue down. The users are under the impression that their phone or the app has crashed.


  1. Open the app

  2. Press the home button on the iPhone and then let the app go into the background for about 20 minutes.

  3. Reopen the app

  4. Double-tap the home button and swipe to Force Quit the app

  5. Some users are reporting seeing a black screen with just the Apple logo and a restart bar at this point.

I do have background location updates running on the app, as well as a background process. I have tried ending this background task when the app re-enters the foreground, but that does not prevent the "apple logo" screen appearing for the users who are already seeing this effect.

Answer Source

Though there was no stacktrace so it was difficult to identify, the below ended up being my problem. I'm documenting it in case someone else runs into something similar.

As mentioned originally, I am creating background processes. This is how I was using them:

Old way:

I declared this at the top of my location manager:

private var bgId: UIBackgroundTaskIdentifier!

then, inside locationManager(_:didUpdateLocations:), I included these lines:

self.bgId = UIApplication.sharedApplication().beginBackgroundTaskWithExpirationHandler { _ in

This was to keep the app alive in the background as long as possible as location readings came in. I thought that since I was using a single reference for bgId, the background tasks would be overwritten and only one would exist, no matter how often location updates came in.

New way:

First, I made bgId optional:

private var bgId: UIBackgroundTaskIdentifier?

Then, I replaced the earlier code snippet in locationManager(_:didUpdateLocations:) with this:

if self.bgId == nil {
  self.bgId = UIApplication.sharedApplication().beginBackgroundTaskWithExpirationHandler { _ in
    if let bgId = self.bgId {
      self.bgId = nil

It's possible that iOS was actually creating a ton of background processes and not overwriting them as I had thought. If true, this approach creates far fewer processes.

After making this change, I no longer see the "respring" effect of the apple logo and restart bar when going through the procedure in my question.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download