Android Question firebase messaging no message

Makumbi

Well-Known Member
Licensed User
Please help i do not receive any message after running B4j push notification please help

B4X:
[jobname=fcm, success=true, username=
, password=, errormessage=, target=class b4j.example.main
, taskid=1, req=anywheresoftware.b4h.okhttp.OkHttpClientWrapper$OkHttpRequest@6ea0c6, response=anywheresoftware.b4h.okhttp.OkHttpClientWrapper$OkHttpResponse@38e57f
, tag=java.lang.Object@177140b, main=null, httputils2service=null
]
{"message_id":5806990528774026092}

after running this below
B4X:
Sub AppStart (Args() As String)
    SendMessage("general", "This is the title", "Hellogggg!!!!")
    StartMessageLoop
End Sub

Private Sub SendMessage(Topic As String, Title As String, Body As String)
    Dim Job As HttpJob
    Job.Initialize("fcm", Me)
    Dim m As Map = CreateMap("to": $"/topics/${Topic}"$)
    Dim data As Map = CreateMap("title": Title, "body": Body)
    m.Put("data": data)
    Dim jg As JSONGenerator
    jg.Initialize(m)
    Job.PostString("https://fcm.googleapis.com/fcm/send", jg.ToString)
    Job.GetRequest.SetContentType("application/json")
    Job.GetRequest.SetHeader("Authorization", "key=" & API_KEY)
End Sub


Sub JobDone(job As HttpJob)
Log(job)
If job.Success Then
Log(job.GetString)
End If
job.Release
StopMessageLoop '<-- non ui app only
End Sub
Logs from my app
B4X:
Please update to B4A-Bridge v2.30+
Logger connected to:  itel itel it1508
--------- beginning of system
--------- beginning of main
** Activity (main) Resume **
ExecuteHtml: SELECT DISTINCT Names,Class || Stream As CS,Amount As Balance FROM Balances
0
** Activity (main) Pause, UserClosed = false **
Logger connected to:  itel itel it1508
--------- beginning of system
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
ExecuteHtml: SELECT DISTINCT Names,Class || Stream As CS,Amount As Balance FROM Balances
0
*** Service (firebasemessaging) Create ***
** Service (firebasemessaging) Start **
*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
** Service (httputils2service) Start **
ResponseError. Reason: java.net.SocketTimeoutException: failed to connect to kccug.com/108.175.14.205 (port 80) after 10000ms, Response:
[{"Account":"05-00001","Name":"BUGEMBE YASIN ismail","Stream":"A","Category":"Active","Country":"S2","Froms":"\/Date(1545512400000)\/","Tos":"\/Date(1554152400000)\/"},{"Account":"05-00005","Name":"DDAMULIRA GEORGE","Stream":"A","Category":"Active","Country":"S5","Froms":"\/Date(1550091600000)\/","Tos":"\/Date(1559163600000)\/"},{"Account":"05-00013","Name":"ASADU","Stream":"A","Category":"Active","Country":"S5","Froms":"\/Date(1548277200000)\/","Tos":"\/Date(1555707600000)\/"}]
(JSONTokener)  at character 0 of [{"Account":"05-00001","Name":"BUGEMBE YASIN ismail","Stream":"A","Category":"Active","Country":"S2","Froms":"\/Date(1545512400000)\/","Tos":"\/Date(1554152400000)\/"},{"Account":"05-00005","Name":"DDAMULIRA GEORGE","Stream":"A","Category":"Active","Country":"S5","Froms":"\/Date(1550091600000)\/","Tos":"\/Date(1559163600000)\/"},{"Account":"05-00013","Name":"ASADU","Stream":"A","Category":"Active","Country":"S5","Froms":"\/Date(1548277200000)\/","Tos":"\/Date(1555707600000)\/"}]
Name: BUGEMBE YASIN ismail
Category: Active
Froms: /Date(1545512400000)/
Tos: /Date(1554152400000)/
12/23/2018
23/12/2018
02/04/2019
02/04/2019
[{"Account":"05-00001","Name":"BUGEMBE YASIN ismail","Stream":"A","Category":"Active","Country":"S2","Froms":"\/Date(1545512400000)\/","Tos":"\/Date(1554152400000)\/"},{"Account":"05-00005","Name":"DDAMULIRA GEORGE","Stream":"A","Category":"Active","Country":"S5","Froms":"\/Date(1550091600000)\/","Tos":"\/Date(1559163600000)\/"},{"Account":"05-00013","Name":"ASADU","Stream":"A","Category":"Active","Country":"S5","Froms":"\/Date(1548277200000)\/","Tos":"\/Date(1555707600000)\/"}]
Name: DDAMULIRA GEORGE
Category: Active
Froms: /Date(1550091600000)/
Tos: /Date(1559163600000)/
14/02/2019
14/02/2019
30/05/2019
30/05/2019
[{"Account":"05-00001","Name":"BUGEMBE YASIN ismail","Stream":"A","Category":"Active","Country":"S2","Froms":"\/Date(1545512400000)\/","Tos":"\/Date(1554152400000)\/"},{"Account":"05-00005","Name":"DDAMULIRA GEORGE","Stream":"A","Category":"Active","Country":"S5","Froms":"\/Date(1550091600000)\/","Tos":"\/Date(1559163600000)\/"},{"Account":"05-00013","Name":"ASADU","Stream":"A","Category":"Active","Country":"S5","Froms":"\/Date(1548277200000)\/","Tos":"\/Date(1555707600000)\/"}]
Name: ASADU
Category: Active
Froms: /Date(1548277200000)/
Tos: /Date(1555707600000)/
24/01/2019
24/01/2019
20/04/2019
20/04/2019
[{"Account":"05-00001","Name":"BUGEMBE YASIN ismail","Stream":"A","Category":"Active","Country":"S2","Froms":"\/Date(1545512400000)\/","Tos":"\/Date(1554152400000)\/"},{"Account":"05-00005","Name":"DDAMULIRA GEORGE","Stream":"A","Category":"Active","Country":"S5","Froms":"\/Date(1550091600000)\/","Tos":"\/Date(1559163600000)\/"},{"Account":"05-00013","Name":"ASADU","Stream":"A","Category":"Active","Country":"S5","Froms":"\/Date(1548277200000)\/","Tos":"\/Date(1555707600000)\/"}]
[{"Account":"05-00001","Name":"BUGEMBE YASIN ismail","Stream":"A","Category":"Active","Country":"S2","Froms":"\/Date(1545512400000)\/","Tos":"\/Date(1554152400000)\/"},{"Account":"05-00005","Name":"DDAMULIRA GEORGE","Stream":"A","Category":"Active","Country":"S5","Froms":"\/Date(1550091600000)\/","Tos":"\/Date(1559163600000)\/"},{"Account":"05-00013","Name":"ASADU","Stream":"A","Category":"Active","Country":"S5","Froms":"\/Date(1548277200000)\/","Tos":"\/Date(1555707600000)\/"}]
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
ExecuteHtml: SELECT DISTINCT Names,Class || Stream As CS,Amount As Balance FROM Balances
0
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…