回答

-1

在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      
      } 

} 
1

getFrom()功能在Android有没有对应的iOS。

作为一种解决方法,您可以在您的data有效内容中为您要发送消息的主题的名称添加自定义键值对。

这也是在answer中提到的建议的解决方法。