If it can serve someone, here is an example for send Firebase Notification from VBA code
that it took me a while to make it work.
that it took me a while to make it work.
B4X:
Private Sub Form_Load()
notifica_firebase "Studio dentistico TecnoDent", "Ciao, ti ricordo l'appuntamento di domani alle ore 10:30", "https://api.androidhive.info/images/minion.jpg"
End Sub
B4X:
Public Sub notifica_firebase(TITOLO As String, TESTONOTIF As String, IMAGEURL As String)
On Error GoTo NOINTERNET
Dim sURL As String
Dim PostData As String
sURL = "https://fcm.googleapis.com/fcm/send"
Dim objXMLHTTP As MSXML2.ServerXMLHTTP
Set objXMLHTTP = New MSXML2.ServerXMLHTTP
PostData = "{""data"":{""title"":""" & _
TITOLO & _
""",""body"":""" & _
TESTONOTIF & _
""",""image"":""" & _
IMAGEURL & _
"""},""to"":""ezCu68iMQKuDJK0yY5Km9s:APA91bHxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxCnaBKn9at-ai9_70vyaEYUlF4RD3YFNipTPyhxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrNvuGouXrnRN0NXhxAHEXr""}"""
'ezCu68iMQKuDJK0.............is mobile TOKEN
With objXMLHTTP
.Open "POST", sURL, False
.SetRequestHeader "Content-Type", "application/json"
.SetRequestHeader "Authorization", "Bearer AAAAiaPkBPoxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiCm1y11tG49WN1SaO-XWk2baT271JKDgxxxxxxxxxxxxxxxxxxxxxxxxxxYED5p7pqnAbJ2"
.Send (PostData)
End With
'Bearer AAAAiaPkBPoxxxxxx..................is server key
Response = objXMLHTTP.ResponseText
freeappo = FreeFile
Open "c:\infostudio\notifica.txt" For Output As #freeappo
Write #freeappo, objXMLHTTP.ResponseText
Close #freeappo
Exit Sub
NOINTERNET:
MsgBox "CONTROLLARE LA CONNESSIONE AD INTERNET " & err.Description, vbCritical
End Sub