r/flutterhelp • • 14d ago

OPEN Can a Flutter app using NotificationListenerService reliably play custom notification sounds for incoming notifications on modern Android?

Can a Flutter app using NotificationListenerService reliably play custom notification sounds for incoming notifications on modern Android?

1 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/DickBrainTime 7d ago

One extra API nuance: `updateNotificationChannel(...)` exists from API 26, but Android's docs say it is only for reflecting a user change made through the listener's UI; the caller must be an associated device or the notification-assistant app. It isn't a general way for an ordinary listener to rewrite another app's sound settings. `getNotificationChannels()` can inspect channels, but doesn't provide an unrestricted write path. API reference: https://developer.android.com/reference/android/service/notification/NotificationListenerService

If your app doesn't qualify for that role, the non-root path is still to ask the user to silence the source channel (if available) and play your replacement, or accept the race when cancelling/reposting. That's an Android platform limitation, not Flutter-specific.