add jpush 启动广告页

This commit is contained in:
lianxiang
2018-08-22 17:53:17 +08:00
parent b7bedad48c
commit 3b8f57d02f
24 changed files with 545 additions and 34 deletions
+6 -3
View File
@@ -63,20 +63,22 @@
// Required
NSDictionary * userInfo = response.notification.request.content.userInfo;
GILog(@"ios(10.0)-userInfo%@",userInfo);
if([response.notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
[JPUSHService handleRemoteNotification:userInfo];
}
completionHandler(); // 系统要求执行这个方法
}
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(NSInteger))completionHandler API_AVAILABLE(ios(10.0)){
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(NSInteger))completionHandler API_AVAILABLE(ios(10.0)){
// Required
NSDictionary * userInfo = notification.request.content.userInfo;
//GILog(@"userInfo%@",userInfo);
if([notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
[JPUSHService handleRemoteNotification:userInfo];
}
completionHandler(UNNotificationPresentationOptionAlert); // 需要执行这个方法,选择是否提醒用户,有Badge、Sound、Alert三种类型可以选择设置
completionHandler(UNNotificationPresentationOptionAlert|UNNotificationPresentationOptionSound|UNNotificationPresentationOptionBadge); // 需要执行这个方法,选择是否提醒用户,有Badge、Sound、Alert三种类型可以选择设置
}
@@ -90,10 +92,10 @@
NSLog(@"did Fail To Register For Remote Notifications With Error: %@", error);
}
//ios8 以下本应用可忽略
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
// Required, iOS 7 Support
GILog(@"iOS 7 userInfo%@",userInfo);
[JPUSHService handleRemoteNotification:userInfo];
completionHandler(UIBackgroundFetchResultNewData);
}
@@ -102,6 +104,7 @@
// Required,For systems with less than or equal to iOS6
[JPUSHService handleRemoteNotification:userInfo];
}