Hi
I created app following this post: https://www.b4x.com/android/forum/t...s-firebase-cloud-messaging-fcm.67716/#content
It is working fine but there is a problem:
When I sending message while app is running in background; I got notification icon with message title/body text as written fine.
But when I sending message while app is running in foreground; I got notification icon with message title/body text as "null" !!!
What is the problem?
I want to use vb .net aspx to send.
only if b4a app is in background, I got notification fine using my aspx send.
Is there a reason for this behavior ?
Check if the B4J code works for you first!!
If it works; compare the B4J Code to your vb code and adapt your vb code to do the same as the B4J Code does.
Excellent,
sent successfully from aspx vb, Its notification output as your B4J code, i got it whatever b4a app in foreground or background ...
my vb.net code is:
B4X:
''using system.net webclient
Dim wc As New WebClient
wc.Encoding = Encoding.UTF8
wc.Headers.Add("Content-Type", "application/json")
wc.Headers.Add("Authorization", "key=yourlongkey")
Dim jsonvalues As String
jsonvalues = "{""data"":{""title"":""This is the title"",""body"":""Hello!!!!""},""to"":""\/topics\/general""}"
wc.UploadString("https://fcm.googleapis.com/fcm/send", jsonvalues)