Symptom
After a notification is published, no error log is reported, and no notification is displayed in the notification bar.
Possible Causes
The notification switch of the corresponding application is turned off.
Solution
Turn on the notification switch of the corresponding application in the system settings of a real device so that the published notification can be viewed in the notification bar.
Solution 1: Go to Settings > Notifications & status bar. Tap the target application and turn on Allow notifications.
Solution 2: call the notificationManager.requestEnableNotification() API to display a dialog box (only once) to prompt the user to enable the feature.
Reference