Event when app CLOSED


#1

Is there an event, in a native app, to tell me when the app is closed. I’m not talking about paused/resumed. I’m talking when someone double clicks on IOS home button then swipes up.

I would like to log my users out when that happens on auth0. I am not storing their tokens, so the user will have to “log in” next time he starts the app, but I want the full log out to be processed on auth0.

I have the code to process the logout. I just need to know where to call it. Interactively, the user can hit logout and all is good.


#2

hi , just use Background Mode plugin and make it enable , he will be enable when your app is closed , so you just need to check if this plugin is enable to know if your app is closed ,

on ios you can use Background Fetch , this plugin can wakes up your app about every 15 minutes , so you can send message to your api or call a function …

background mode : https://ionicframework.com/docs/native/background-mode/
background fetch : https://ionicframework.com/docs/native/background-fetch/


#3

What I’m shooting for is when the app is physically closed, to make a call to auth0… then let it close. Am I misunderstanding what I read in the docs? This doesn’t look like it would help with that.


#4

There is no way to handle a force close in your app - as your app is force closed and not running any more. You will have to find a different way to handle this.