0

AppDelegateのapplicationDidEnterBackground関数でローカル通知を行う方法を知っています。

- (void)applicationDidEnterBackground:(UIApplication *)application

{{

UILocalNotification * uln = [[UILocalNotification alloc] init];
uln.fireDate = [NSDate dateWithTimeIntervalSinceNow:10];
uln.timeZone = [NSTimeZone defaultTimeZone];

uln.alertBody = @"Did you forget something?";
uln.alertAction = @"Show me";
uln.soundName = UILocalNotificationDefaultSoundName;
//uln.applicationIconBadgeNumber = 0;
uln.repeatInterval = NSMinuteCalendarUnit;
application.scheduledLocalNotifications = [NSArray arrayWithObject:uln];

}

しかし、ユーザーがfireDateの時間を設定し、深夜のように時間を邪魔しないようにすることは可能ですか?

4

1 に答える 1

1

はい、firedateプロパティを将来の任意の日付に設定できます。ユーザーがiOS6の設定で自分自身をトリガーすることは可能です。

于 2012-12-09T22:06:09.793 に答える