I like to get a Pause call when the my PWA app is in background on iOS. But this do not work. Please help
func _notification(what) -> void: if what == MainLoop.NOTIFICATION_WM_FOCUS_OUT: print('pause)
The NOTIFICATION_WM_FOCUS_OUT notification is only sent on desktop platforms, not mobile platforms.
NOTIFICATION_WM_FOCUS_OUT
aa that make sense.
Is there an other way to find out if the pwa is in background?
@Calinou said: The NOTIFICATION_WM_FOCUS_OUT notification is only sent on desktop platforms, not mobile platforms.
So the documentation is incorrect? It states that notification applies to all platforms. https://docs.godotengine.org/en/stable/classes/class_mainloop.html#constants
@DaveTheCoder said: So the documentation is incorrect? It states that notification applies to all platforms. https://docs.godotengine.org/en/stable/classes/class_mainloop.html#constants
Actually, the notification is supposed to be sent on Android: https://github.com/godotengine/godot/blob/72427737aea1ecb08d9c625664f63f05ea2d8435/platform/android/os_android.cpp#L320-L324
However, it's likely that the script is never run in time to get this notification since the application has already went out of focus by the time the notification is done emitting. Recent Android devices are very adamant about killing apps as early as they can to save battery :(