Hello
When I receive the message, an exception is generated.
precisely this:
I think the problem is here, but I do not know how to fix it, do you have any idea?
////////////////////////////////////////////////////////
LOG
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
** Receiver (firebasemessaging) OnReceive **
** Service (firebasemessaging) Start **
Message arrived
Message data: ID 0:1531664675242804%959093b8959093b8, Data {}
firebasemessaging_fm_messagearrived (java line: 156)
java.lang.IllegalArgumentException: Invalid notification (no valid small icon): Notification(pri=0 contentView=null vibrate=default sound=default defaults=0x7 flags=0x11 color=0x00000000 vis=PRIVATE)
at android.app.NotificationManager.notifyAsUser(NotificationManager.java:318)
at android.app.NotificationManager.notify(NotificationManager.java:293)
at android.app.NotificationManager.notify(NotificationManager.java:277)
at anywheresoftware.b4a.objects.NotificationWrapper.Notify(NotificationWrapper.java:281)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:191)
at anywheresoftware.b4a.BA$1.run(BA.java:330)
at android.os.Handler.handleCallback(Handler.java:761)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
When I receive the message, an exception is generated.
precisely this:
B4X:
firebasemessaging_fm_messagearrived (java line: 156)
java.lang.IllegalArgumentException: Invalid notification (no valid small icon): Notification(pri=0 contentView=null vibrate=default sound=default defaults=0x7 flags=0x11 color=0x00000000 vis=PRIVATE)
I think the problem is here, but I do not know how to fix it, do you have any idea?
B4X:
Dim map As Map
map.Initialize
map.Put("title","title")
map.Put("body","body")
////////////////////////////////////////////////////////
LOG
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
** Receiver (firebasemessaging) OnReceive **
** Service (firebasemessaging) Start **
Message arrived
Message data: ID 0:1531664675242804%959093b8959093b8, Data {}
firebasemessaging_fm_messagearrived (java line: 156)
java.lang.IllegalArgumentException: Invalid notification (no valid small icon): Notification(pri=0 contentView=null vibrate=default sound=default defaults=0x7 flags=0x11 color=0x00000000 vis=PRIVATE)
at android.app.NotificationManager.notifyAsUser(NotificationManager.java:318)
at android.app.NotificationManager.notify(NotificationManager.java:293)
at android.app.NotificationManager.notify(NotificationManager.java:277)
at anywheresoftware.b4a.objects.NotificationWrapper.Notify(NotificationWrapper.java:281)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:191)
at anywheresoftware.b4a.BA$1.run(BA.java:330)
at android.os.Handler.handleCallback(Handler.java:761)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
B4X:
Sub fm_MessageArrived (Message As RemoteMessage)
Log("Message arrived")
Log($"Message data: ID ${Message.MessageId}, Data ${Message.GetData}"$)
Dim map As Map
map.Initialize
map.Put("title","title")
map.Put("body","body")
Dim jgen As JSONGenerator
jgen.Initialize(map)
Dim n As NB6
n.Initialize("default", Application.LabelName, "DEFAULT").AutoCancel(True)
n.Build(Message.GetData.Get("title"), Message.GetData.Get("body"), jgen.ToString, Main).Notify(4)
End Sub