0

I register my VC for UIApplicationDidEnterBackgroundNotification

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidEnterBackgroundNotification:) name:UIApplicationDidEnterBackgroundNotification object:nil];

However the notification gets triggered when the app enters foreground, not when it entered background

I assume

  • that the notification callback happens in next run loop, however, when the app enters background, this next runloop is executed when the app enters foreground

Is there any workaround for this to act really on Entering background?

Peter Lapisu
  • 19,915
  • 16
  • 123
  • 179

1 Answers1

0

You could try using the UIApplicationWillResignActiveNotification notification instead, that's when it's about to move to the background. Otherwise, I could answer you better about why it's not getting called until the app becomes active if you add some of your code to the question.

Bek
  • 2,206
  • 20
  • 35