Notification sound does not play when the device screen is locked

I have a notification (instance Notification) with sound (set using NotificationCompat.Builder.setSound(Uri sound)). If the screen (or the device you know) is unlocked and a notification is generated, I also hear a sound, but if the screen is locked and the notification I hear nothing, because notifications are generated only when the screen is unlocked, because they are “visible notifications” , or can I hear when sreen is locked? If not, how can I generate a sound notification when the screen is locked? / P>

+4
source share

Source: https://habr.com/ru/post/1608567/


All Articles