commit | author | age
|
537198
|
1 |
// |
H |
2 |
// WAIPush.h |
|
3 |
// WASdkIntfUI |
|
4 |
// |
|
5 |
// Created by hank on 2017/4/1. |
|
6 |
// Copyright © 2017年 GHW-T-01. All rights reserved. |
|
7 |
// |
|
8 |
|
|
9 |
#import <Foundation/Foundation.h> |
|
10 |
#import <UIKit/UIKit.h> |
|
11 |
#import <UserNotifications/UserNotifications.h> |
|
12 |
|
|
13 |
@interface WAIPush : NSObject |
|
14 |
|
|
15 |
// 注册通知 |
|
16 |
- (void)application:(UIApplication *)application initPushWithDelegate:(id<UNUserNotificationCenterDelegate>)delegate; |
|
17 |
|
|
18 |
// 调用过用户注册通知方法之后执行 |
|
19 |
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings; |
|
20 |
|
|
21 |
// 获取deviceToken |
|
22 |
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken; |
|
23 |
|
|
24 |
// 注册失败 |
|
25 |
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error; |
|
26 |
|
|
27 |
#pragma mark IOS8 IOS9 Push Notification Receive |
|
28 |
// 接收本地通知 |
|
29 |
-(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification; |
|
30 |
// 接收远程通知 |
|
31 |
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler; |
|
32 |
|
|
33 |
#pragma mark IOS10 Push Notification Receive |
|
34 |
//App处于前台接收通知时 |
|
35 |
- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler; |
|
36 |
|
|
37 |
// 通知的点击事件 |
b4b831
|
38 |
- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler; |
537198
|
39 |
|
H |
40 |
// 程序进入后台 |
|
41 |
- (void)applicationDidEnterBackground:(UIApplication *)application; |
|
42 |
|
|
43 |
// 程序将进入前台 |
|
44 |
- (void)applicationWillEnterForeground:(UIApplication *)application; |
|
45 |
|
|
46 |
// 程序进入前台 |
|
47 |
- (void)applicationDidBecomeActive:(UIApplication *)application; |
|
48 |
|
|
49 |
// 拉取消息 |
|
50 |
- (void)pullNotification; |
|
51 |
|
|
52 |
@end |