Is it possible to detect if the user will remove the app in Nativescript?
I need it to unsubscribe the users in the topics of Firebase.
Thanks.
Is it possible to detect if the user will remove the app in Nativescript?
I need it to unsubscribe the users in the topics of Firebase.
Thanks.
Option 1: Use this solution to implement a BroadcastReceiver to catch the uninstall. Here is the documentation on Nativescript BroadcastReceiver
Option 2: Catch the event indirectly, using events like the one explained in this link. When your app package cache folder is deleted, you can catch the event in a forked process (In JS part of your NS app) and call your firebase function/update values in RT DB.
For iOS, looks like you may have to find indirect solutions by pinging as explained here and here.
Based on these solutions, it would be a lot simpler and effecient to stop ping and log devices which are not receiving the messages for n days(a parameter you can configure in Firebase remote config). On app launch event, you can reset this value, where you maintain a unique ID and active since for each device.
If you go through uninstall route, you might be restricted to limited option in Android.