2

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];
4

0 に答える 0