Home > Net >  Is there something like onDelete / onRemove in Flutter
Is there something like onDelete / onRemove in Flutter

Time:08-29

Is there any way to trigger a function on app delete. I want to execute one last code if user delete the app.

we use didChangeAppLifecycleState() function if user close, pause etc. the app. But I need a function to be triggered once if the app is removed from device. Which is something like:

onDelete(){
   sendRequestToFirebase();
}

CodePudding user response:

Not sure if the app by itself know when its being uninstalled. Since the app will not even be open. You can try to implement a push notification system with FCM token. If firebase throws an error saying not registered then you can assume that the app has been uninstalled. Though you can't invoke any method by this method.

  • Related