     withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
     let userInfo = notification.request.content.userInfo
     // Print message ID.
-    if userInfo[gcmMessageIDKey] != nil {
-      print("Message ID: \(userInfo[gcmMessageIDKey]!)")
+    if let messageID = userInfo[gcmMessageIDKey] {
+      print("Message ID: \(messageID)")
     }
 
     // Print full message.

    // TODO: Handle data of notification

    // Print message ID.
    if userInfo[gcmMessageIDKey] != nil {
      print("Message ID: \(userInfo[gcmMessageIDKey]!)")
    }

    // Print full message.

                              withCompletionHandler completionHandler: @escaping () -> Void) {
    let userInfo = response.notification.request.content.userInfo
    // Print message ID.
    if let messageID = userInfo[gcmMessageIDKey] {
      print("Message ID: \(messageID)")
    }

    // Print full message.
