私はiOSの目的cのアラームベースプロジェクトに取り組んでいます。 アプリケーションがバックグラウンドのときにアラームのためにUILocalnotification
を実装しました。 しかし、私が直面している問題は、音が30秒間しか再生されないということです。30秒以上のアラームアプリケーションのためのUILocalnotification
サウンドの時間間隔を増やすにはどうすればよいですか、またはUILocalnotification
の代わりにサウンドを実装する方法が他にありますか。
- (IBAction)Alert:(id)sender{
NSDateFormatter *format = [[NSDateFormatter alloc] init];
[format setDateFormat:@"yyyy-MM-dd"];
//NSDate *date = [NSDate date];
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
localNotif.fireDate =[NSDate dateWithTimeIntervalSinceNow:15];
localNotif.timeZone = [NSTimeZone localTimeZone];
localNotif.alertBody = @"Emergency";
localNotif.alertAction = @"View";
localNotif.soundName = @"police.mp3";
localNotif.applicationIconBadgeNumber = 1;
localNotif.repeatInterval = NSYearCalendarUnit;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
}
Note : mp3 file i am using for UILocalnotification is of more that 60min duration.
アドバイスをしてください。 ありがとう
このファイルを複数の30音ファイルに分割し、複数の通知を行う必要があります。 – Tj3n
@ Tj3n返信いただきありがとうございます。しかし私のmp3ファイルは30秒以上です。 –