title: Get Values from Push Notification iOS Swift 4
body: <p>I Implement Push Notification in my application. When someone send me a message i received data against that message, I want to perform some action with that data i received but i am unable to get values. Here is my code.</p>
  
  <pre><code>func messaging(_ messaging: Messaging, didReceive remoteMessage: MessagingRemoteMessage) {
      print("Received data message: \(remoteMessage.appData)")
  
      guard let data = try? JSONSerialization.data(withJSONObject: remoteMessage.appData, options:.prettyPrinted),
      let prettyPrinted = String(data: data, encoding: .utf8) else { return }
      print("Received direct channel message:\n\(prettyPrinted)")
  }
  </code></pre>
  
  <p>Here is my console Output.</p>
  
  <pre><code>Received data message: [AnyHashable("chat"): {"date":"1 second(s) 
  ago","img":"http:\/\/adforest-testapp.scriptsbundle.com\/wp- 
  content\/plugins\/adforest-rest-api\/images\/user.jpg","ad_id":"439","id":244,"text":"hi","type":"reply"}, 
  AnyHashable("adId"): 439, AnyHashable("from"): 170168176816, 
  AnyHashable("title"): Honda Civic 2017 Type R, AnyHashable("message"): 
  hi, AnyHashable("senderId"): 47, AnyHashable("recieverId"): 1, 
  AnyHashable("topic"): chat, AnyHashable("type"): receive]
  </code></pre>
  
  <p>Here is my Pretty Printed JSON.
  Received direct channel message:</p>
  
  <pre><code>{
  "chat" : "{\"date\":\"1 second(s) 
  ago\",\"img\":\"http:\\\/\\\/adforest-testapp.scriptsbundle.com\\\/wp- 
  content\\\/plugins\\\/adforest-rest-api\\\/images\\\/user.jpg\",\"ad_id\":\"439\",\"id\":244,\"text\":\"hi\",\"type\":\"reply\"}",
  "adId" : "439",
  "from" : "170168176816",
  "title" : "Honda Civic 2017 Type R",
  "message" : "hi",
  "senderId" : "47",
  "recieverId" : "1",
  "topic" : "chat",
  "type" : "receive"
  }
  </code></pre>
  
  <p>Kindly guide me how I get key value from this and used to perform some action.</p>