简体   繁体   中英

Change notification sound in iOS Flutter

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM