【发布时间】:2013-04-16 06:36:17
【问题描述】:
当应用程序在前台时,本地通知声音不播放:我使用了以下代码
UILocalNotification *notif = [[cls alloc] init];
notif.fireDate = [datePicker date];
notif.timeZone = [NSTimeZone defaultTimeZone];
notif.alertBody = @"Did you forget something?";
notif.alertAction = @"Show me";
notif.soundName = @"step.mp3";//UILocalNotificationDefaultSoundName;
notif.applicationIconBadgeNumber = 1;
NSDictionary *userDict = [NSDictionary dictionaryWithObject:reminderText.text
forKey:kRemindMeNotificationDataKey];
notif.userInfo = userDict;
[[UIApplication sharedApplication] scheduleLocalNotification:notif];
[notif release];
【问题讨论】:
-
希望这个链接有帮助 - stackoverflow.com/questions/9555564/…