0
我试图用声音在本地通知目标c代码,但我无法获得声音。我的通知即将到来,但声音无效。打开通知声音不工作,但通知即将到来
UIUserNotificationType types = UIUserNotificationTypeBadge |
UIUserNotificationTypeSound | UIUserNotificationTypeAlert;
UIUserNotificationSettings *mySettings =
[UIUserNotificationSettings settingsForTypes:types categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:mySettings];
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
if (localNotif == nil)
return;
localNotif.timeZone = [NSTimeZone defaultTimeZone];
localNotif.alertBody=msg;
localNotif.alertAction = NSLocalizedString(@"View Details", nil);
localNotif.soundName = UILocalNotificationDefaultSoundName;
//[email protected]"sound.caf";
localNotif.applicationIconBadgeNumber = 1;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
是你的iPhone在静音模式:P – 2014-11-25 07:40:44
没有我的iPhone不处于静音模式。 – 2014-11-25 09:03:22
然后进入设置并检查声音是否打开,以便推送您的应用程序... – 2014-11-25 13:07:49