title: How to read custom data sent in push notification using Firebase
body: <p>I am trying to retrieve "data" which I sent in push notification using Firebase in iOS Application(Swift)</p>
  
  <p>here is the code which I used to send notification :</p>
  
  <pre><code>{
     "to": "dWB537Nz1GA:APA91bHIjJ5....",
     "data":
     {
        "message": "Offer!",
        "mediaUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/FloorGoban.JPG/1024px-FloorGoban.JPG"
     },
     "notification":
     {
        "body": "Enter your message",
        "sound": "default"
     }
  }
  </code></pre>
  
  <p>I implemented only one method to read data from notification :</p>
  
  <pre><code>func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -&gt; Void) {
      //checked where I can get custom data which I sent but no success
      let notification =  response.notification.request.content.body
  
      print("Notification recived content:\(response.notification.request.content)")
      print("userNotificationCenter : didReceive response body : \(notification)")
      print("userNotificationCenter : didReceive response user info : \(response.notification.request.content.userInfo)")
      print("userNotificationCenter : response : \(response)")
  
  
      completionHandler()
  }
  </code></pre>
  
  <p>Checked in above method where I can get custom data which I sent but no success</p>
  
  <p>I searched for solution at so many places but no success. Please help me to retrieve custom data.</p>
  
  <p>Thank you in advance!</p>