Change notification sound in iOS Flutter
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
Comments
-
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 about 3 yearsWhere exactly is this line found sir?
-
SardorbekR about 3 years@Lefty This is flutter code. I think this is property of local_notification package
-
K.Amanov almost 3 yearsWhat is the destination folder for aiff file?
-
SardorbekR almost 3 years@ZEHINZ shown in this video youtube.com/watch?v=LtRTWdGrF3s
-
K.Amanov almost 3 yearsI placed it in the root folder and that worked. Thank you!
-
Zainal Muttaqin over 2 yearsi 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?