'MessagingRemoteMessage' is deprecated: FCM direct channel is deprecated, please use APNs for downstream message handling.
프로그래밍/swift2020. 10. 20. 00:21
pod update를 해서 그런가.. 기존에 없던 warning이 발생하네요.
'MessagingRemoteMessage' is deprecated: FCM direct channel is deprecated, please use APNs for downstream message handling.
무슨 말인지 잘 모르겠습니다.
extension AppDelegate : MessagingDelegate {
// [START refresh_token]
func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String) {
print("Firebase registration token: \(fcmToken)")
fToken = fcmToken
let dataDict:[String: String] = ["token": fcmToken]
NotificationCenter.default.post(name: Notification.Name("FCMToken"), object: nil, userInfo: dataDict)
// TODO: If necessary send token to application server.
// Note: This callback is fired at each app startup and whenever a new token is generated.
}
// [END refresh_token]
// [START ios_10_data_message]
// Receive data messages on iOS 10+ directly from FCM (bypassing APNs) when the app is in the foreground.
// To enable direct data messages, you can set Messaging.messaging().shouldEstablishDirectChannel to true.
func messaging(_ messaging: Messaging, didReceive remoteMessage: MessagingRemoteMessage) {
print("Received data message: \(remoteMessage.appData)")
}
// [END ios_10_data_message]
}
fcm때문에 추가한 코드 같은데.. 문제가 되는 부분을 주석 처리해도 문제가 없는 것 같네요.
참고
댓글 영역