Android Question NB6 large icon problem

Mostez

Well-Known Member
Licensed User
Longtime User
I use this code with firebase notification to display large icon notification but only smallicon method worked ok, what is wrong in this code?
TIA
B4X:
Sub fm_MessageArrived (Message As RemoteMessage)
    
        Dim body As String = Message.GetData.Get("body")
        Dim title As String = Message.GetData.Get("title")
        Dim logo As Bitmap = LoadBitmapResize(File.DirAssets, "logo.png", 256dip, 256dip, True)
        
        Dim n As NB6
        n.Initialize("default", Application.LabelName, "HIGH").LargeIcon(logo)   
        n.BigTextStyle(title, "", body)
        n.Build(title, body, "", Me).Notify(1)

here is the error log:

** Receiver (firebasemessaging) OnReceive **
** Service (firebasemessaging) Start **
Error occurred on line: 289 (NB6)
java.lang.IllegalArgumentException: Invalid notification (no valid small icon): Notification(channel=default_HIGH shortcut=null contentView=null vibrate=null sound=null defaults=0x0 flags=0x0 color=0x00000000 vis=PRIVATE)
at android.app.NotificationManager.fixNotification(NotificationManager.java:603)
at android.app.NotificationManager.notifyAsUser(NotificationManager.java:582)
at android.app.NotificationManager.notify(NotificationManager.java:531)
at android.app.NotificationManager.notify(NotificationManager.java:507)
at anywheresoftware.b4a.objects.NotificationWrapper.Notify(NotificationWrapper.java:284)
at com.etrip.firebasemessaging._fm_messagearrived(firebasemessaging.java:197)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
at anywheresoftware.b4a.BA$1.run(BA.java:352)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7977)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:603)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
 

Similar Threads

Top