控制LocalNotification卷?

时间:2012-04-04 06:07:51

标签: ios5

有没有办法在ios中设置LocalNotification的音量。我已经编写了这段代码并且它工作正常但我没有办法设置本地通知的音量。代码如下:

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

if (localNotification==nil) {
    return;
}

localNotification.fireDate=date;
localNotification.timeZone=[NSTimeZone defaultTimeZone];
localNotification.repeatCalendar=[NSCalendar currentCalendar];
localNotification.alertBody=[NSString stringWithFormat:@"%@",[tmpdict objectForKey:@"Reminder"]];

NSDictionary *snoozeDic=[tmpdict objectForKey:@"Snooze"];
if ([[snoozeDic valueForKey:@"Switch"]intValue]==1) {
    localNotification.alertAction=@"Snooze";
}else
{
    localNotification.hasAction=NO;
}

localNotification.repeatInterval=CalUnit;
localNotification.soundName=[NSString stringWithFormat:@"%@.caf",[tmpdict objectForKey:@"Tone"]];
localNotification.userInfo=[NSDictionary dictionaryWithObject:tmpdict forKey:@"AlarmInfo"];
localNotification.applicationIconBadgeNumber=1;

[[UIApplication sharedApplication]scheduleLocalNotification:localNotification];

0 个答案:

没有答案