[英]How to get the topic out of a Firebase message notification in iOS?
在Android中,您可以使用getFrom()
从通知中读取主题。 有人可以帮助我如何在iOS中了解这一点吗?
在Appdelegate中。 实现以下功能,您可以在userInfo中获取它。
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject],
fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) {
// Access userInfo
let aps = userInfo["aps"] as? NSDictionary
if let aps = aps {
let alert = aps["alert"] as! NSDictionary
let body = alert["body"] as! String
let title = alert["title"] as! String
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.