我创建 UILocalNotification 和 UIMutableUserNotificationAction
如果我使用 iphone,这个动作按钮似乎但我使用 ipad,这个动作按钮似乎没有
UIMutableUserNotificationAction *action = [[UIMutableUserNotificationAction alloc]init];
action.identifier = @"ActionNotification";
action.title = @"START";
action.activationMode = UIUserNotificationActivationModeForeground;
UIMutableUserNotificationCategory *categorys = [[UIMutableUserNotificationCategory alloc]init];
categorys.identifier = @"alert";
[categorys setActions:@[action] forContext:UIUserNotificationActionContextMinimal];
UIUserNotificationSettings *setings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert|UIUserNotificationTypeBadge|UIUserNotificationTypeSound categories:[NSSet setWithObjects:categorys, nil]];
[[UIApplication sharedApplication] registerForRemoteNotifications];
[[UIApplication sharedApplication] registerUserNotificationSettings:setings];
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = aIntervalDate;
//localNotification.fireDate = [NSDate dateWithTimeIntervalSinceNow:5];
localNotification.alertBody =@"Notification Test";
localNotification.alertAction=@"START";
localNotification.category=@"alert";
localNotification.soundName = @"Reminder_Sound.mp3";
localNotification.applicationIconBadgeNumber=1;
// localNotification.hasAction=YES;
NSDictionary *infoDict = @{@"title" : @"xxxxxx",
@"tipi" : @"yyyyy"};
localNotification.userInfo = infoDict;
localNotification.timeZone = [NSTimeZone systemTimeZone];
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];