Fuse.App.Current.Window.Closing is not triggered on mobile devices

In my app I have some values I wish to save when the app is closed. But for some reason the Fuse.App.Current.Window.Closing event is never triggered on Android (I have not checked iOS yet).

Is there any other event that is triggered when an app on Android/iOS is closed that I can use instead?

Hi Anders, Whilst the lifecycle code is solid for android it is currently under a strange name. Platform2.Application is the class with the events you want.

The events are:

public static event ApplicationStateTransitionHandler Started;
public static event ApplicationStateTransitionHandler EnteringForeground;
public static event ApplicationStateTransitionHandler EnteringInteractive;
public static event ApplicationStateTransitionHandler ExitedInteractive;
public static event ApplicationStateTransitionHandler EnteringBackground;
public static event ApplicationStateTransitionHandler Terminating;

The name of Platform2 is obviously not great, this is an area of the codebase I am working on right now and it will replace Platform very soon.

The advantage is that the lifecycle has deterministic flow you will be able to rely on for all platforms. Currently it is only that way for mobile.

Happy to explain more if needed so ask away :slight_smile:

Perfect! That’s just what I needed, thank you very much :slight_smile: