如何更改播放本地通知的声音?我使用下面的代码播放默认声音:
notif.soundName = UILocalNotificationDefaultSoundName;
Run Code Online (Sandbox Code Playgroud)
所以,我在下面尝试了这个,它没有用.我该怎么办?谢谢你的帮助!
notif.soundName = @"sound.caf";
Run Code Online (Sandbox Code Playgroud) 我已经为我的应用程序完成了基本通知.我想在我的通知中添加声音效果.
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
if (localNotification == nil)
return;
localNotification.fireDate = [NSDate date];
//localNotification.timeZone = [NSTimeZone defaultTimeZone];
localNotification.alertBody = msg;
localNotification.soundName = @"Morse.aiff";
[[UIApplication sharedApplication] presentLocalNotificationNow:localNotification];
Run Code Online (Sandbox Code Playgroud)
如何添加音效?