Change notification sound in iOS Flutter

4,019

You should replace this default given sound name to your sound name.

var iOSPlatformChannelSpecifics = IOSNotificationDetails(sound: 'slow_spring_board.aiff'); //put your own sound text here 

(Before this, your sounds should be added to your project using Xcode) Here is the link how to add custom sound to your project for iOS devices using Xcode: https://medium.com/@dmennis/the-3-ps-to-custom-alert-sounds-in-ios-push-notifications-9ea2a2956c11

Note: Sound duration should be less than 30 seconds otherwise it will not work

Share:
4,019
SardorbekR
Author by

SardorbekR

Mobile (iOS/Flutter) Developer

Updated on December 21, 2022

Comments

  • SardorbekR
    SardorbekR over 1 year

    I want to use my own sound in push notification in iOS platform of Flutter. Since I have no experience in iOS development, I am struggling with it.

    In my app settings there are 3 notification sound options, so that user can choose notification sound. I have already implemented local_notifications package and although I am getting notifications in my app, I couldn't find how to use custom sound in push notification for iOS platform.

  • Lefty
    Lefty about 3 years
    Where exactly is this line found sir?
  • SardorbekR
    SardorbekR about 3 years
    @Lefty This is flutter code. I think this is property of local_notification package
  • K.Amanov
    K.Amanov almost 3 years
    What is the destination folder for aiff file?
  • SardorbekR
    SardorbekR almost 3 years
    @ZEHINZ shown in this video youtube.com/watch?v=LtRTWdGrF3s
  • K.Amanov
    K.Amanov almost 3 years
    I placed it in the root folder and that worked. Thank you!
  • Zainal Muttaqin
    Zainal Muttaqin over 2 years
    i have a 28 seconds duration notification. But its only appear about 5-10 seconds (the sound stopped after pop up notification disappear). Could you help my problem?