-
-
Notifications
You must be signed in to change notification settings - Fork 695
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
Implement on mobile: App.exit, App.on_exit, and Window.close #1623
Comments
This was at least partially intentional, as mobile apps don't really have a "quit/exit" concept that is analogous to desktop apps. I was actually a little surprised to see that AFAIK, iOS doesn't even have an API for "quit app" - I guess we could manufacture one with a SIGINT or similar, but that's not really "expected" iOS behavior. So - I'm not sure what the right solution is here. Keeping the API but making it a no-op is a little weird; we should perhaps improve the logging message to lean into the "you shouldn't be doing this" messaging; or we could completely remove the entry point on mobile. As a comparison datapoint: Cordova/PhoneGap doesn't support Quit on iOS; it's a no-op (same as it is here). |
From #1622:
A user-visible quit command isn't part of the standard style on Android either. However, if someone makes an app on the desktop which happens to have an exit button, and then tries running it on mobile (which is exactly what happened in #1622), isn't it better for it to work rather than do nothing? It's certainly possible to implement the method in a reasonable way: simply close all activities, then exit the process. It looks like neither iOS nor Android implements I suggest we come back to this when we're ready to start thinking about multi-window apps on mobile. |
I'm not sure I agree that implementing an API in a way that violates the HIG for the platform is desirable. I'd almost argue that exposing Window.close is a slightly different issue, as that ties into what multiple-window apps "mean" on mobile. However, in both cases, I agree that we can put a pin in this discussion until we get to dealing with multi-window apps etc. |
See #1803 for discussion about |
As far as I know, this has still not been implemented. From #2419 by @greenshelll:
|
While I agree that there's an opportunity to hook into the Android On Windows, the exit event is a request, and can be rejected by the handler - that's how you implement an "Are you sure?" dialog on exit. On Android, you're being informed that the app is shutting down. There's no way (that I'm aware of) to prevent OnDestroy for happening or completing. At the very least, this needs to be flagged in documentation, as it's a significant platform deviation. It's also worth noting that hitting the "back" button on Android isn't necessarily a "Destroy". It's more likely to be an |
There's no way to reject onStop or onDestroy, but there is a way to intercept the back button itself with the |
Like Android (#1622), the iOS backend does not implement the
exit
method.The text was updated successfully, but these errors were encountered: