title: How can I receive remote message from fcm in swift 4 when the app is not running?
body: <p>I have already registered my app in Firebase console for my iOS application in Xcode 9, the problem I have is that I can receive the message just when the app is in background or suspend mode , and also can receive it in foreground. </p>
  
  <p>1: I am using </p>
  
  <pre><code>Messaging.messaging().subscribe(toTopic: "/topics/my-topic")
  </code></pre>
  
  <p>to subscribe to my topic. </p>
  
  <p>and I send it with postman : </p>
  
  <pre><code>{
      "to":"/topics/my-topic",
      "content_available": true,
     "data":
     {
          "message": "some message.."
     }
  }
  </code></pre>
  
  <p>2: I receive the message in the app delegate</p>
  
  <pre><code> func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -&gt; Void) {
          UIApplication.shared.applicationIconBadgeNumber = 0
      }
  </code></pre>
  
  <p>. </p>
  
  <p>How can I receive the message from the topic and do a local push notification when the <strong>app is not running</strong> ?</p>