Hello
I have search all forms but I can't find a solution
I try too sent a notification with a button
I looks like I am logged in but i get this error
Here is the code
and here is the errror
I have add to my manifest
Firebase Base
Google Play Services Base
Firebase Analytics
Firebase Notifications
Firebase Auth
I can also sent notifications from my console!
But i want sent it from the app with the button
I have search all forms but I can't find a solution
I try too sent a notification with a button
I looks like I am logged in but i get this error
Here is the code
B4X:
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
#BridgeLogger: True
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Layout1")
Starter.analytics.SendEvent("login", CreateMap ("additional parameter": 100))
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
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;charset=UTF-8")
Job.GetRequest.SetHeader("Authorization", "key=" & "key" )
End Sub
Sub JobDone(job As HttpJob)
Log(job)
If job.Success Then
Log(job.GetString)
End If
job.Release
End Sub
Sub Button1_Click
SendMessage("Topic" ,"hi"," how are you")
End Sub
and here is the errror
B4X:
[errormessage=, httputils2service=null, jobname=fcm
, password=, req=anywheresoftware.b4h.okhttp.OkHttpClientWrapper$OkHttpRequest@5e8a6a, success=true
, tag=java.lang.Object@e696b5b, target=class com.avestudio.noti.main, taskid=2
, username=]
{"message_id":6277805898007252715}
I have add to my manifest
Firebase Base
Google Play Services Base
Firebase Analytics
Firebase Notifications
Firebase Auth
I can also sent notifications from my console!
But i want sent it from the app with the button