【发布时间】:2014-04-30 06:02:02
【问题描述】:
我正在开发一个使用UILocalNotifications 的iphone 应用程序。发生通知时,会显示通知横幅,但没有声音。即来自NotificationCenter 的禁用(关闭)声音。如何在不进入设置的情况下默认启用(开)通知声音。谢谢提前
我正在使用
UILocalNotification *notification = [[UILocalNotification alloc]init];
[notification setAlertBody:alertBody];
[notification setFireDate:thedate2];
[notification setTimeZone:[NSTimeZone defaultTimeZone]];
notification.soundName = UILocalNotificationDefaultSoundName;
notification.applicationIconBadgeNumber = 1;
[[UIApplication sharedApplication]scheduleLocalNotification:notification];
【问题讨论】:
-
转到设置-通知->然后检查是否启用了声音。如果不启用它
-
我认为不去设置是不可能的..
标签: ios iphone uilocalnotification