概述
通过上面分析可以得知,如果app进程没有启动,当接收到通知的时候,点击通知栏打开app不会调用didReceiveRemoteNotification方法,那么就需要在didFinishLaunchingWithOptions方法中获取通知内容,代码如下:
-(void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler{}
再走展示通知的代理方法
-(void)jpushNotificationCenter:(UNUserNotificationCenter*)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(NSInteger))completionHandler{}
点击通知:
-(void)jpushNotificationCenter:(UNUserNotificationCenter*)center didReceiveNotificationResponse:(UNNotificationResponse*)response withCompletionHandler:(void (^)())completionHandler{}
收到通知:
-(void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler{}
点击通知:
-(void)jpushNotificationCenter:(UNUserNotificationCenter*)center didReceiveNotificationResponse:(UNNotificationResponse*)response withCompletionHandler:(void(^)())completionHandler{}
点击icon不走回调
2.不设置content_available字段
1)前台:
收到通知:
-(void)jpushNotificationCenter:(UNUserNotificationCenter*)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(NSInteger))completionHandler{}
点击通知:
-(void)jpushNotificationCenter:(UNUserNotificationCenter*)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(NSInteger))completionHandler{}
附上极光官方其他问题链接:https://community.jiguang.cn/t/4-ios/11243
点击打开链接
最后
以上就是发嗲白开水为你收集整理的ios 关于不同状态下收到极光apns通知的处理总结的全部内容,希望文章能够帮你解决ios 关于不同状态下收到极光apns通知的处理总结所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复