-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Android and iOS Focus/Unfocus MainLoop Notifications #8453
Comments
I have a "first draft" of this ready to go since I wanted it for my own purposes even if this isn't accepted, I have tested it on both iOS 17 and Android 12. |
cc @m4gr3d
Android tablets and desktop mode (such as DeX) have multi-window support, so unfocusing the window might mean something different than you'd expect (i.e. it could behave the same as on desktop platforms). |
When the time comes, should I split the PRs into an iOS fork and an Android fork due to the different considerations? iPadOS does support multi window, but Godot doesn't support it at the moment, so it's a bit simpler to execute. |
I think it'd be better to have separate PRs for Android and iOS indeed. |
Should I go ahead and open them on the main project? I don't remember the approval process for proposals. |
Sure 🙂 |
Implemented by godotengine/godot#85100. |
Describe the project you are working on
A mobile game.
Describe the problem or limitation you are having in your project
Some functionality is difficult to access and others is missing in relation to apps sent to the background. The missing functionality on iOS could be used as part of an autosave system, as long as the saving process takes less than 5 seconds. (https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1622997-applicationdidenterbackground, A warning should probably be included in any relevant documentation that if it takes longer than "approximately five seconds" the app will be completely killed.)
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Implements missing functionality on iOS and makes development easier for both platforms.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
This will implement NOTIFICATION_APPLICATION_RESUMED and NOTIFICATION_APPLICATION_PAUSED on iOS, allowing the user to know for certain the app has entered the background instead of just being unfocused. applicationWillResignActive (the only lose focus signal from iOS Godot can currently process) being triggered doesn't necessarily mean the app is going to go into the background, as things like an incoming phone call will send that signal.
I also think that NOTIFICATION_APPLICATION_FOCUS_IN and NOTIFICATION_APPLICATION_FOCUS_OUT should be implemented on iOS and Android. The implementation should be relatively basic, as they are both already wired to fire NOTIFICATION_WM_WINDOW_FOCUS_IN and NOTIFICATION_WM_WINDOW_FOCUS_OUT upon their respective OS signaling they have lost focus.
If this enhancement will not be used often, can it be worked around with a few lines of script?
NOTIFICATION_APPLICATION_FOCUS_IN and NOTIFICATION_APPLICATION_FOCUS_OUT can be worked around, but on iOS NOTIFICATION_APPLICATION_RESUMED and NOTIFICATION_APPLICATION_PAUSED has no equivalent.
Is there a reason why this should be core and not an add-on in the asset library?
This cannot be an add-on.
The text was updated successfully, but these errors were encountered: