Hi, I developed an app who send personalized alarms set in the app, then the application register the device FCMTOKEN when the device login, and delete from the server when the user logout.
Lately, I receive complaints of ex-users receiving their alarms, the main reason is that they just uninstall the app, and as is a JWT stateless app, the app is always logged.
My solution was tried to create a service to verify the uninstallation and delete the token from the server, to do it I created a module:
#Region Service Attributes
#StartAtBoot: False
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Public broadcastIntent As Intent
Public broadcastIntentID As String
End Sub
Sub Service_Create
broadcastIntentID = "android.intent.action.ACTION_PACKAGE_FULLY_REMOVED" ' must match the Manifest entry
End Sub
Sub Service_Start (StartingIntent As Intent)
Log("Intent Action: "&StartingIntent.Action&" looking for: "&broadcastIntentID)
If StartingIntent.Action = broadcastIntentID Then
Wait For (REST.API.LogOut) Complete (Success As Boolean)
Service.StopAutomaticForeground
End If
End Sub
Sub Service_Destroy
End Sub
send set this values on the manifest:
'Unintall checkout
AddReceiverText(BroadcastReceiverService,
<intent-filter>
<action android:name="android.intent.action.ACTION_PACKAGE_FULLY_REMOVED" />
</intent-filter>)
But seems not be working, am I doing something wrong?