I'm playing around with the NB6 class from here:
https://www.b4x.com/android/forum/threads/nb6-notifications-builder-class-2018.91819/#content
And I'm using version 1.01 of NB6.bas
I am running on a Samsung 5S with APK 23.
I am specifically playing with HIGH and LOW priority notifications.
I have found I encounter the problem as outlined here:
https://www.b4x.com/android/forum/threads/nb6-example-problem.98872/#content
And have amended the NB6 example Main code as follows:
This solves the problem for HIGH priority but LOW priority bombs immediately with:
https://www.b4x.com/android/forum/threads/nb6-notifications-builder-class-2018.91819/#content
And I'm using version 1.01 of NB6.bas
I am running on a Samsung 5S with APK 23.
I am specifically playing with HIGH and LOW priority notifications.
I have found I encounter the problem as outlined here:
https://www.b4x.com/android/forum/threads/nb6-example-problem.98872/#content
And have amended the NB6 example Main code as follows:
B4X:
Sub HighPriority_Notification
Dim n As NB6
n.Initialize("default", Application.LabelName, "HIGH").SmallIcon(smiley)
'This avoids a problem, see:
'https://www.b4x.com/android/forum/threads/nb6-example-problem.98872/#content
Dim notification As Notification = n.Build("", "", "", Me)
notification.Cancel(9)
notification.Notify(9)
n.Build("Important!!!", "Content", "tag", Me).Notify(9)
End Sub
Sub LowPriority_Notification
Dim n As NB6
n.Initialize("default", Application.LabelName, "LOW").SmallIcon(smiley)
'This avoids a problem, see:
'https://www.b4x.com/android/forum/threads/nb6-example-problem.98872/#content
Dim notification As Notification = n.Build("", "", "", Me)
notification.Cancel(10)
notification.Notify(10)
n.SetDefaults(False, False, False)
n.Build("Not important...", "Content", "tag", Me).Notify(10)
End Sub
This solves the problem for HIGH priority but LOW priority bombs immediately with:
android.app.RemoteServiceException: Bad notification posted from package b4a.example3: Couldn't update icon: StatusBarIcon(icon=Icon(typ=RESOURCE pkg=b4a.example3 id=0x00000000) visible user=0 )
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2019)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)