3

Like title, I'm facing a really strange bug on some my user device. I've search but I cant find any exactly same problem like me.

Here's some more detail about this bug:

  • applicationDidBecomeActive is not called but other delegate (didFinishLaunchingWithOptions, applicationWillEnterForeground, applicationDidEnterBackground,...) are called normally.
  • Bug disappear when restart device.
  • Not always happen, all is working normally and then suddenly this bug appear and break my app flow.
  • When my app is having this bug, other app are facing same bug too if they are using applicationDidBecomeActive to do something important (like Facebook Messenger as I can see, it cant reset unread message and badge number).

I believe this is an iOS system bug, anyone can confirm it? If not, how do I fix that? Thanks!

  • 8
    Does your app have a Scene Delegate ([`UIWindowSceneDelegate`](https://developer.apple.com/documentation/uikit/uiwindowscenedelegate))? If so you may want to use [`sceneDidBecomeActive(_:)`](https://developer.apple.com/documentation/uikit/uiscenedelegate/3197915-scenedidbecomeactive) – Emma Labbé Aug 24 '20 at 17:18
  • @AdrianLabbé, no, I have read about it but my app is not using it – Tiến Nguyễn Hữu Aug 25 '20 at 00:29

1 Answers1

0

SceneDelegate in overwriting AppDelegate methods.

enter image description here enter image description here

You can implement your code in SceneDelegate or Remove SceneDelegate from target: see how: https://stackoverflow.com/a/59006569/1111879

Ofir Malachi
  • 1,145
  • 14
  • 20