I am trying to implement push notification as described in the documentation.
I am getting build error while updating the following method in xcode project:
#if USE_PUSH
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
Messaging.messaging().apnsToken = deviceToken
InstanceID.instanceID().instanceID { (result, error) in
if let error = error {
NotificationCenter.default.post(name: Notification.Name(CAPNotifications.DidFailToRegisterForRemoteNotificationsWithError.name()), object: error)
} else if let result = result {
NotificationCenter.default.post(name: Notification.Name(CAPNotifications.DidRegisterForRemoteNotificationsWithDeviceToken.name()), object: result.token)
}
}
}
Getting build error like:
Static member ‘instanceID’ cannot be used on instance of type 'InstanceID’
I have updated pod file as mentioned in the documentation and installed it in xcode project.
I have seen in the web many people have faced i but nobody got any solution as of now.