The notification sound using Flutter Local Notification for Android not working at all here is the code
const NotificationDetails(
android: AndroidNotificationDetails(
'daily notification channel id',
'daily notification channel name',
'daily notification description',
playSound: true,
sound: RawResourceAndroidNotificationSound('pop'),
importance: Importance.max,
priority: Priority.high,
),
),
And I have pop.mp3 in this path: \android\app\src\main\res\raw\pop.mp3
How can I play the sound?
For Android 8.0+, sounds and vibrations are associated with notification channels and can only be configured when they are first created. Showing/scheduling a notification will create a channel with the specified id if it doesn't exist already. If another notification specifies the same channel id but tries to specify another sound or vibration pattern then nothing occurs.
Solution => Please change Channel id, name, description, it will be fine.
My problem was that I was testing the app on Xiaomi and I realized that Xiaomi has some problems and it by default doesn't allow notification sound. Somehow it didn't work on the emulator too, but by testing it on other physical devices it worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With