#import "AppDelegate.h"
#import "GlobalDefine.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// 判断是否是8.0以上
if ([UIDevice currentDevice].systemVersion.floatValue >= 8.0) {
UIMutableUserNotificationCategory *category = [[UIMutableUserNotificationCategory alloc] init];
category.identifier = NotificationIdentifier;
UIMutableUserNotificationAction *foregroundAction = [[UIMutableUserNotificationAction alloc] init];
foregroundAction.identifier = foregroundActionidentifier;
foregroundAction.title = @"前台模式";
foregroundAction.activationMode = UIUserNotificationActivationModeForeground;
UIMutableUserNotificationAction *backgroundAction = [[UIMutableUserNotificationAction alloc] init];
backgroundAction.identifier = backgroundActionidentifier;
backgroundAction.title = @"后台模式";
backgroundAction.activationMode = UIUserNotificationActivationModeBackground;
[category setActions:@[foregroundAction, background