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

后端 未结 4 2024
春和景丽
春和景丽 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:29

    You should be able to retrieve the body using something like:

    let body = remoteMessage.appData["notification"]!["body"] as! String
    print(body)
    

提交回复
热议问题