I use FirebaseMessaging for recibe message in app
when main opens, the user loses the window they are in. I think I cannot launch a MSGBOX from the FIREBASENOTIFY service
and in main:
when main opens, the user loses the window they are in. I think I cannot launch a MSGBOX from the FIREBASENOTIFY service
B4X:
Sub NotificacionLocal(Title As String, Body As String, Tipo As String )
Dim NewNotificacion As NB6
Dim IdNotificacion As Int
Private smiley As Bitmap
Try
Log("NotificacionLocal a")
smiley = LoadBitmapResize(File.DirAssets, "f.ico", 24dip, 24dip, False)
'DEFAULT - PRIORITY
NewNotificacion.Initialize( "default", Application.LabelName, "HIGH").SmallIcon(smiley)
IdNotificacion = 10
NewNotificacion.AddButtonAction(smiley, Tipo & " Entendido", ServicioNotificacion, "2")
Dim cs As CSBuilder
If Tipo.ToUpperCase = "UPLOAD" Then
NewNotificacion.AddButtonAction(Null, cs.Initialize.Color(Colors.Red).Bold.Append( "Descarga").PopAll, ServicioNotificacion, "1")
else if Tipo.ToLowerCase ="VERSION" Then
Else if Tipo.ToUpperCase = "MSG" Then
'Msgbox(Body,Title)
CallSubDelayed3(Main,"Msg",Body,Title)
'Msgbox2Async(Body,Title,"ACEPTAR","","",modGeneral.BM,False)
else if Tipo.ToUpperCase ="GPS" Then
CN.NotificarLatLon
End If
NewNotificacion.DeleteAction(ServicioNotificacion, "delete action")
NewNotificacion.AutoCancel(True)
Noti = NewNotificacion.Build(Title, Body, "tag", Main)
Noti.Notify(IdNotificacion)
Log("NotificacionLocal Z")
Catch
Log(LastException)
End Try
End Sub
and in main:
B4X:
private Sub Msg(T1 As String, T2 As String)
Msgbox2Async(T1,T2,"ACEPTAR","","",modGeneral.BM,False)
End Sub