Cambios en como se envian los cambios de ubicacion y como se mantiene el servicio activo

This commit is contained in:
2023-09-30 06:00:20 -06:00
parent c9e05a01df
commit 68bac1707c
6 changed files with 112 additions and 32 deletions

View File

@@ -72,9 +72,18 @@ Sub Service_Destroy
End Sub
Sub NotiMon_NotificationPosted (SBN As StatusBarNotification)
If Not(Tracker.FLP.IsInitialized) Then
If Tracker.FLP.IsInitialized Then
' Log($"FLP.IsInitialized - ${Tracker.flp.IsInitialized}"$)
' Log($"FLP.IsConnecting - ${Tracker.flp.IsConnecting}"$)
' Log($"FLP.IsConnected - ${Tracker.flp.IsConnected}"$)
Else
' Log($"FLP.IsInitialized - False"$)
End If
If Not(Tracker.FLP.IsInitialized) Or Not(Tracker.flp.IsConnected) Then
StartService(Tracker) 'Si el servicio no esta corriendo, lo iniciamos.
Subs.gps_hist.ExecNonQuery($"insert into BITACORA (RUTA, TEXTO, FECHA) values ('${Starter.devModel}', 'Recibimos notificación, Tracker apagado, INICIANDOLO!!', '${Subs.fechaKMT(DateTime.now)}')"$)
Subs.bitacora($"Recibimos notificación, Tracker apagado, INICIANDOLO!!"$)
' Subs.gps_hist.ExecNonQuery($"insert into BITACORA (RUTA, TEXTO, FECHA) values ('${Starter.devModel}', 'Recibimos notificación, Tracker apagado, INICIANDOLO!!', '${Subs.fechaKMT(DateTime.now)}')"$)
End If
Private logger As Boolean = True
If Starter.logger Then LogColor(SBN.PackageName & " - " & SBN.Message, Colors.blue)
@@ -88,8 +97,11 @@ Sub NotiMon_NotificationPosted (SBN As StatusBarNotification)
' Si recibimos un mensaje con la palabra "donde", "Donde" o "bien", entonces mandamos la última ubicación conocida.
If SBN.Message.Contains("donde") Or SBN.Message.Contains("Donde") Or SBN.Message.Contains("bien") Then 'Si el mensaje contiene "#NS" y tiene un segundo parametro ...
If esMensajeWAValido(SBN) Then
Subs.gps_hist.ExecNonQuery($"insert into BITACORA (RUTA, TEXTO, FECHA) values ('${Starter.devModel}', 'Recibimos notificación, iniciamos StartFLP y guardamos UUC', '${Subs.fechaKMT(DateTime.now)}')"$)
Subs.bitacora($"Recibimos notificación, iniciamos StartFLP y guardamos UUC"$)
' Subs.gps_hist.ExecNonQuery($"insert into BITACORA (RUTA, TEXTO, FECHA) values ('${Starter.devModel}', 'Recibimos notificación, iniciamos StartFLP y guardamos UUC', '${Subs.fechaKMT(DateTime.now)}')"$)
CallSubDelayed2(Tracker, "dameUltimaUbicacionConocida", Starter.UUC)
FirebaseMessaging.locRequest = "Activa"
CallSubDelayed2(FirebaseMessaging,"mandamosLoc", Starter.UUC)
CallSubDelayed(Tracker, "StartFLP")
If Starter.logger Then Log("Mandamos a Server")
End If