2

나는 푸시 알림을 위해 Firebase를 사용하고 있습니다. didRegisterForRemoteNotificationsWithDeviceToken에서Firebase 푸쉬 알림 - XCode 8.0/Swift 3.0/ios 10.0

, 나는 다음과 같은 라인을 가지고 :

FIRInstanceID.instanceID().setAPNSToken(deviceToken, type: FIRInstanceIDAPNSTokenType.prod) 

나는 다음과 같은 오류 메시지가 얻을 :

예상 인수 유형 '데이터'에 유형의 '데이터'값을 변환 할 수 있습니다.

답변

0

4.0.0에 중포 기지 SDK를 업데이트하고 다음 코드를 추가

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { 

     Messaging.messaging().apnsToken = deviceToken 

     let firebaseAuth = Auth.auth() 
     // .sandbox is used during development, later on it can be changed to .prod 

     firebaseAuth.setAPNSToken(deviceToken, type: AuthAPNSTokenType.sandbox) 
}