I have two Android devices, Android 7.0 and Android 8.1.0 and am trying to use CodenameOne to send push notifications to them. When I send push notifications (type 99) it displays on the Android 8 device properly. However, the Android 7.0 device seem to collect all push notifications in tray and show only briefly - for less than a second or not to show it at all. I can see that the notification was received only if the device is sleeping (the screen is black). But after I unlock the phone, the notifications are not shown anymore.
Also, another problem that might be related: in my push(String value)
method I implemented ToastBar with notification body message in case if display is not minimized. So after I receive push notification in Android 7 device and then open the app (even if it was minimized when the push was received), I can see ToastBar (Or many of them, if there were few pushes. It's not suppose to happen).
Android logs for receiving push seem to be fine in both versions. They look like this:
2021-03-08 12:14:52.308 16422-21684/com.company.app I/System.out: Message received {messageType=3, category=reminder, message=Reminder !;{'id':'251'} }
2021-03-08 12:14:52.308 16422-21684/com.company.app I/System.out: Push message received: Reminder !;{'id':'251'}
2021-03-08 12:14:52.308 16422-21684/com.company.app I/System.out: Push type: 3
2021-03-08 12:14:52.30816422-21684/com.company.app I/System.out: Is running: false
However, I noticed that Android 7.0 Phone also has this:
2021-03-08 11:46:07.686 1548-1548/? V/NotificationService: pkg=com.company.app canInterrupt=false intercept=true
Bug resolved my removing android.background_push_handling=true
from build hints in codenameone_settings.properties