您的位置:首页 > 大数据 > 人工智能

Unable to connect with FCM. Optional(Error Domain=com.google.fcm Code=501

2016-10-19 02:38 751 查看
Solution: open push notification and in backgroud mode open remote notification in Xcode 8

iOS 9.3

// [START connect_to_fcm]

func connectToFcm() {

//FIRMessaging.messaging().connect { (error) in

FIRMessaging.messaging().connectWithCompletion { (error) in

if (error != nil) {

print(“Unable to connect with FCM. (error)”)

} else {

print(“Connected to FCM.”)

}

}

}
// [END connect_to_fcm]


func applicationDidBecomeActive(application: UIApplication) {

// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.

connectToFcm() //add by Kevin

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐