Localpush(UILocalNotification)
プッシュする部分の実装。
これをbackgroundになったときにどのように実装するかとか決めたいですね
- (void)localpush { NSLog(@"%s", __func__); UILocalNotification *notification = [[UILocalNotification alloc] init]; //5秒後に実行 notification.fireDate = [[NSDate date] dateByAddingTimeInterval:5]; //タイムゾーンはシステムにあわせた方がいいかも notification.timeZone = [NSTimeZone systemTimeZone]; //通知の本文の設定 notification.alertBody = @"ほげほげほげーーーー"; notification.hasAction = YES; //通知タイトルの設定 notification.alertAction = @"通知のタイトルなり"; //通知音の設定 notification.soundName = UILocalNotificationDefaultSoundName; //アイコンの右上にでるバッジの番号 notification.applicationIconBadgeNumber = 100; //値を渡せるようですが、ちょっとよくわかってないですw //NSDictionary *infoDict = [NSDictionary dictionaryWithObject:@"Recevied." forKey:@"kExtra"]; //NSDictionary *infoDict = [NSDictionary dictionaryWithObject: notification.alertAction // forKey:@"bbbbbbbbbbbbb"]; //notification.userInfo = infoDict; [[UIApplication sharedApplication] scheduleLocalNotification:notification]; }