Questions tagged [notification-channel]

Notification Channels introduced with Android 8.0 Oreo.

98 questions
2
votes
3 answers

How to programmatically enable NotificationChannel Sound

I tried setting the sound with the following code, but its not working Uri defaultRingtone = Uri.parse("android.resource://"+getPackageName()+"/raw/alarm"); NotificationChannel channel = new NotificationChannel(JayaGrocer.NOTIFICATION_CHANNEL,…
sanusi
  • 739
  • 7
  • 10
2
votes
0 answers

How can I stop the notification FLAG_INSISTENT after 5 min?

I am setting the FLAG_INSISTENT to my notification to repeat the sound of the notification. My problem is that I do not know how to stop the sound after five minutes to save batteries. I already tried to cancel the notification, but there the user…
naggab
  • 371
  • 4
  • 18
2
votes
1 answer

NotificationChannel setSound and vibration not working

I have a problem to play sound, when notification will come, notification is showing, but there is no sound or vibration, I saw many question and answers to how to set the sound and vibration to notificaiton channels, but it doesn't works, this is…
Jemo Mgebrishvili
  • 5,187
  • 7
  • 38
  • 63
2
votes
2 answers

Notification Channel Id Should be Unique for Each Notification

Since Android 8 notification channels required for notifications. My Question is each and every notification should have different notification channel Id or same channel Id?
kavie
  • 2,154
  • 4
  • 28
  • 53
2
votes
4 answers

NotificationCompat.Builder() not accepting Channel Id as argument

I know this question has been asked several times before. But none of the solutions worked for me. That's why I would like to ask the question again. The following line only accepts NotificationCompat.Builder(context) : NotificationCompat.Builder…
2
votes
1 answer

NotificationChannel notification as alarm when phone is muted (Oreo)

I'm setting the NotificationCompat.Builder with: .setSound(getNotificationSound(), AudioManager.STREAM_ALARM) .setCategory(NotificationCompat.CATEGORY_ALARM) .setPriority(NotificationCompat.PRIORITY_MAX) among the other mandatory properties. For…
2
votes
1 answer

cancelAll() and cancel() don't dismiss my notification

I am facing this problem for a long time now, I have an application with many functions, one of them is the alarm My notification just stays there and never disappears although I am calling cancelAll() / cancel() from the notification manager, also…
2
votes
3 answers

Working with Firebase Push Notifications without Notification channels

I need to generate notifications when a PUSH notification is received but also I need to generate notifications (for display them in the notification bar of the device) when something happens in the application, so I'm using…
2
votes
0 answers

NotificationChannel: listen for changes in the categories (sound changed, vibration enabled)

I have a RingtonePreference and a Vibration Preference and I'm trying to adapt the pre-26 behavior to newer versions of Android. Since it's not possible to update the sound in a NotificationChannel once it's created, I'm planning to delete the old…
adriennoir
  • 1,329
  • 1
  • 15
  • 29
1
vote
2 answers

Notifications only work on certain versions of android

My app uses a receiver to send the user notifications after a certain amount of time. The receiver works great as it runs a few functions, the notification however doesn't work so smoothly. On the emulator (API29 and Android 10) it sends them…
1
vote
0 answers

Removing/Dismissed all notification belong to particular channel in android

I am creating one application where I created two notification channel. Let say, Channel 1 : to show one type of notification channel 2 : to show another type of notification Now I want to dismiss all notification on channel 1 when user click on any…
1
vote
0 answers

Do the notificationchannels need to be created multiple times?

I've always wondered if the application must call createNotificationChannel on every startup or to have they created once on first use is guaranteed to be fine... I ask that because many tutorials like this:…
Rafael Lima
  • 3,079
  • 3
  • 41
  • 105
1
vote
0 answers

How to make android Foreground Service Notification Sticky in Chinese ROMs?

I tried everything to run service in background using foreground service and it works on all devices except chinese devices like vivo, oppo, oneplus. These devices kills the service as soon as the app is killed from recent list. Even the foreground…
1
vote
0 answers

Android custom notification sound for FCM in Flutter not working

I have a custom notification sound for FCM in my Flutter App working properly when I set the targetSdkVersion to 25 but once I change the targetSdkVersion to 28 default sound is played instead of custom sound. I'm using plugin firebase_messaging…
1
vote
4 answers

Action icon added in notification not showing up

I am trying to create a notification for Incoming call. For that I have added two actions in notification. My action text only is displayed.Action icon is not displayed in notification. I want to add icon near Answer and cancel which I added as…
Kousalya
  • 700
  • 10
  • 29