我使用Firebase进行推送通知。
在didRegisterForRemoteNotificationsWithDeviceToken
中,我有以下行:
FIRInstanceID.instanceID().setAPNSToken(deviceToken, type: FIRInstanceIDAPNSTokenType.prod)
我收到以下错误消息:
无法转换类型'数据'的值预期参数类型'数据'。
答案 0 :(得分:0)
将Firebase 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)
}