Skip to content

Commit

Permalink
update RemoteNotificationDemo
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenYilong committed Nov 22, 2016
1 parent b90e898 commit 3859dc6
Showing 1 changed file with 3 additions and 4 deletions.
Expand Up @@ -50,7 +50,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
ViewController *vc = [[ViewController alloc] init];
vc.title = @"LocalNatification-Demo";
vc.title = @"RemoteNatification-Demo";
self.navigationController = [[UINavigationController alloc] initWithRootViewController:vc];
[self.window addSubview:vc.view];
self.window.rootViewController = self.navigationController;
Expand Down Expand Up @@ -148,7 +148,7 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center

/**
* Required for iOS 10+
* 在后台和启动之前收到推送内容, 执行的方法
* 在后台和启动之前收到推送内容,点击推送内容后执行的方法
*/
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
didReceiveNotificationResponse:(UNNotificationResponse *)response
Expand All @@ -158,8 +158,7 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center
//TODO:处理远程推送内容
NSLog(@"%@", userInfo);
}
// 需要执行这个方法,选择是否提醒用户,有 Badge、Sound、Alert 三种类型可以选择设置
completionHandler(UNNotificationPresentationOptionBadge + UNNotificationPresentationOptionSound);
completionHandler();
}

#endif
Expand Down

0 comments on commit 3859dc6

Please sign in to comment.