- Home /
Custom Sounds on Local Notifications? (iOS)
I'm using local push notifications for a project that i'm currently working on, the notifications themselves are working absolutely fine. The problem is trying to use a custom sound for the notification. I'm using the SoundName variable within LocalNotification and setting it to "soundName.fileFormat" but this is not working.
Debug.Log ("About to play aiff.");
LocalNotification notif = new LocalNotification();
notif.alertAction = "alert";
notif.fireDate = DateTime.Now.AddSeconds(5);
notif.alertBody = "Playing aiff sound";
notif.soundName = "chicken.aiff";
notif.applicationIconBadgeNumber = -1;
NotificationServices.ScheduleLocalNotification(notif);
One thing i'm trying to figure out is where to put the soundfile itself? I'm assuming that this is a native iOS function and that the file may have to be in a certain place for this to work?
Lastly i have tried this with 5 different file formats (aiff, caf, m4a, mp3, wav).
Thanks in advanced.
Hi @swinny89! Please provide us with an answer of your findings, it's a neat thing if someone else is having the same problem.
Answer by swinny89 · Sep 02, 2013 at 02:58 PM
The problem was the location of where i had the file, after building the project for iOS in unity and opening xcode, drag the sound file (i'm using .wav) into xcode ontop of the unity project. A pop up will then appear, set the target to the unity project. Build and run on a device and hey presto! :)
Can someone confirm that it's "impossible" to do it on iOS without relying on manual xcode changes rather than unity build ?
Your answer
Follow this Question
Related Questions
Push Notifications iOS & Android Vuforia & UrbanAirship 0 Answers
Android/iOS notifications when the game is not running 1 Answer
Android & iOS Push Notifications 3 Answers
iOS Notifications without Server 2 Answers
iOS - Audio Volume Too Loud 0 Answers