Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 107 [details]
The following code does not add the custom sound to the LocalNotification:
string audioFilePath = Path.Combine(Environment.CurrentDirectory, "swannee.aif");
localNote.SoundName = audioFilePath;
When it fires an error is returned stating that the file cannot be found. Examining the bundle, the file is there...
You did not supply a full test case so I cannot tell you exactly what's wrong with your code. However here's how I got this to work.
a) first make sure that your .aif file is added as "Content" into your project (in MD, right click on your solution, select "Build Action" menu and select "Content". Otherwise the file won't be inside included properly into the bundle.
b) there's the code I used:
public void LocalNotification ()
UILocalNotification n = new UILocalNotification ();
// the current directory is already set to the bundle directory
n.SoundName = "swannee_original.aif";
n.AlertBody = "body";
n.AlertAction = "action";
n.ApplicationIconBadgeNumber = 42;
n.FireDate = NSDate.Now.AddSeconds (30);
n.TimeZone = NSTimeZone.DefaultTimeZone;
and called the method from FinishedLaunching
c) I statred the app in the simulator, hit the home button (so it went on the background) and waited 30 seconds.
d) I got the notification plaing your sound