1
iOS 处在前台的时候,接收到通知是不会在通知栏中展示通知横条的
2
处在前台收到通知,会执行
-(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler 代理方法,
我们可以在这个方法中进行自定义处理
前提是 要遵守 UNUserNotificationCenterDelegate 协议