How to get the body of a push notification sent from Firebase console in iOS 10 and Swift 3?

后端 未结 4 2016
春和景丽
春和景丽 2021-01-03 00:15

I\'m developing an iOS app that should receive push notifications sent from the Firebase console. I\'m using Swift 3 and iOS 10.

As recommended by the Firebase docum

4条回答
  •  [愿得一人]
    2021-01-03 00:32

    You should be able to print any line from the response with this :

    let response = remoteMessage.appData
    
    print(response[AnyHashable("notification")] as Any)
    

    Apple documentation on AnyHashable : https://developer.apple.com/reference/swift/anyhashable

提交回复
热议问题