2

我正在使用Firebase推送通知。Firebase推送通知 - XCode 8.0/Swift 3.0/ios 10.0

didRegisterForRemoteNotificationsWithDeviceToken,我有以下行:

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

我收到以下錯誤信息:

無法將類型的值「數據」預期參數類型「數據」。

回答

0

更新您的火力地堡的SDK 4.0.0 添加以下代碼:

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