title: iOS Notification creating an Alert
body: <p>I'm creating an iOS-Native app. I'm using XCode 8, testing on iOS10, using swift 3.</p>
  
  <p>I'm dealing with APNS and sending Remote notifications (through OneSignal).</p>
  
  <p>The notifications work flawlessly outside my app (when it is in background). However, when I have the app in foreground, no matter what I pass into the <code>completionHandler()</code> (ex. <code>[.alert, .sound]</code>, or <code>[.sound]</code> or <code>[]</code>) the system creates a <code>UIAlertController</code> with the contents of the notification (title and body) and presents it to the user. This is incredibly obnoxious as a user-interface and I would imagine there is some way to work around it.</p>
  
  <p>I'm implementing the <code>UNUserNotificationCenterDelegate</code> as follows:</p>
  
  <pre><code>extension ViewController: UNUserNotificationCenterDelegate{
  func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -&gt; Void) {
  
  
      //This is my BRYXBanner notification presentation/
      let banner = Banner(title: notification.request.content.title, subtitle: notification.request.content.body, image: nil, backgroundColor: .blue, didTapBlock: nil)
      banner.alpha = 0.9
      banner.animationDuration = 0.2
      banner.position = .top
      banner.show(genView, duration: 3.0)
  
  
      completionHandler([])
  }
  
  func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -&gt; Void) {    
      switch(response.actionIdentifier){
      //switch cases for actions/
      default: break
      }
      completionHandler([])
  }
  }
  </code></pre>
  
  <p>I'm also implementing the <code>UIApplicationDelegate</code> but that one simply has print statements.</p>
  
  <p>What I'm seeing when I receive a notification is this:
  <a href="https://i.stack.imgur.com/QyATa.png" rel="nofollow noreferrer">Screenshot of a custom notification I sent for this</a></p>
  
  <p>I've seen others have had this issue (<a href="https://stackoverflow.com/questions/42384753/how-to-disable-default-notification-alert-view-on-ios-remote-notifications">How to disable default notification alert view on iOS remote notifications?</a>) but have no idea how they got around it. Most posts simply lead to "oh, I fixed it" with no further explanation.</p>
  
  <p>How can I bypass the showing of this notification, whether it be silencing the notification (if that works) or dealing with the completion handler or intercepting the notification before it is displayed?</p>