UILocalNotifications custom sound ....

Dear developers,


Since several days, I'm trying to work with a UILocalNotifications in order to perform tests of a my app. When I created the XCode project, in it i included several sounds file *.mp4a and the app worked perfectly. Succcesively I try to include some audio files, with same extension, in the Documents directory of the app. But writing in the code for example: "notif.soundName=[[@"%@/Documents/MySound.m4a" lastPathComponent] copy];", when the app is in the background modality, the notification sound is the default. Kindly I would like if anyone could help me in solving this problem if it is possible.


The UILocalNotification settings are the following:


UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert;

UIUserNotificationSettings *mySettings = [UIUserNotificationSettings settingsForTypes:types categories:nil];

[[UIApplication sharedApplication] registerUserNotificationSettings:mySettings];

UILocalNotification *notif = [[UILocalNotification alloc] init];

............................................

............................................


iOS version in use are:

8.4.1 on a iPod touch 5nd generation;

9.0.1 on a iPhone 6;


Thanks a lot for Your Paid Attention and have a nice day.


Cassino, September 24, 2015

I realize this is a year old, but did you solve it?

Try deleting the app from the device and reloading it. I'm having a similar issue with iOS 9 and 10.

UILocalNotifications custom sound ....
 
 
Q