Exit from an app

HI guys

how do you exit from a Fuse app, any other way other than taskmanager ? Any change in this direction with next BackButton android trigger ?

Thanks for your great job Max

You can try with this:


Hi Bjorn

I just had chance to implement it in my app and it works fine ! Inside a Whiletrue, now I can use BackButton to navigate on my main page, or to exit if already on main page.

Very useful also to better understand Uno/Android interaction (just testing a “Toast” message… :wink: Thanks. Max

Hello Bjorn,

what if I need to terminate the app from JS with your example, rather than from ux ? Would it be possible ?

Thanks Max

Yes. Easiest now is to use WhileTrue and an Observable setting it to true.

How to define Observable? The issue i’m experiencing is that back button kills the app no matter on which page I’m; I want to implement solution in which back button get user back to previous page and only if the user is in the starting page, the app is being killed.

sasha: Observable documentation can be found here. You should definitely get acquainted with them as they’re a key concept of Fuse. :slight_smile:

I know how to use Observables, of course :slight_smile: I’ve asked how to use it in this case.

I assume what Bolav suggested was to let your JS track which page you’re on / when it should be possible to exit using the backbutton and then you update the observable according to that.

Your UX is then simply something along the lines of:

<WhileTrue Value="{ShouldExit}" Bypass="Never">
    <HomeScreen Type="Finish" />

However, if you just want to control it all from JS then it’d make much more sense (and be more elegant) to just expose those functions directly through a JS API.
You can read here to see how you could make one based on the code in the repo.

1 Like

How to exit app on IOS ? This works only on android https://github.com/bolav/fuse-homescreen

@zoran: AFAIK you don’t “exit” apps on iOS. You just put them in background by pressing the Home button, or you kill them from the expose screen shown when double-clicking the Home button.

Or am I missing something?

@Uldis No, you’re right… I did not know how works IOS… Tnx a lot