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
}