flutterpush-notificationflutter-dependenciesflutter-local-notification

Playing custom sounds for flutter_local_notification


I need to play a custom alert for push notifications and I'm using flutter_local_notification. I have added an audio file in android/app/src/main/res/raw/ and also enabled playSound to true, but it still plays the default sound. Is there anything I missed?

    var androidPlatformChannelSpecifics = const AndroidNotificationDetails(
      'channel_id',
      'channel_name',
      enableLights: true,
      enableVibration: true,
      sound: RawResourceAndroidNotificationSound("notification"),
      playSound: true,
      
     

enter image description here


Solution

  • ISSUE FIXED
    I just reinstalled the app and now the custom sound is playing.

    Explanation
    Once a notification channel created we can't overwrite, we either need to create an another channel or reinstall with new configuration.

    If there are any other explanation or answers, You are welcome.