Reacting to Dark Mode for ios 13

Reacting to Dark Mode for ios 13
0

Hi! I want my cocos game to react to dark mode change on ios 13 like the following video:

I noticed that when i change ios 13 dark mode on/off, cocos will not react to changes and draw until all native ios screens in front are removed. The reason is because the app correctly checks in CCDirectorCaller-ios.mm if the app is active before drawing.

18%20AM

If i remove isAppActive check, the issue is fixed but i guess it is potentially dangerous for crashes. What if I change the check to become inactive from UIApplicationWillResignActiveNotification to UIApplicationDidEnterBackgroundNotification? This will allow the app to draw in more cases but still pause on background. Is it safe? Is app allowed to draw if UIApplicationWillResignActiveNotification is called but not UIApplicationDidEnterBackgroundNotification?

willResignActive - Can app still draw?
didEnterBackround - App CANNOT draw here 100%.

Also is there a way to make cocos draw a single frame?

@zhangxm i guess u will know the answer )