Save game when player closes it on Android

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By JulioYagami

I tried triggering game saving through notifications, it worked but the player can “avoid” the save by closing the app through the current apps button and this way notifications wont ve triggered. Is there a way to get it “unavoidable”?

:bust_in_silhouette: Reply From: LoneDespair

func _notification(what):
what == MainLoop.NOTIFICATION_WM_FOCUS_OUT:
print(“Save your game”)