Using the method
[FIRInstanceID tokenWithAuthorizedEntity:scope:options:handler]
Im not quite sure what the parameters are calling for? What is
Version for Swift
(based on @HeadOnn's answer):
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)
{
Messaging.messaging().setAPNSToken(deviceToken, type: .prod) // may be excess
guard let plistPath = Bundle.main.path(forResource: "GoogleService-Info", ofType: "plist"),
let options = FirebaseOptions(contentsOfFile: plistPath)
else { return }
InstanceID.instanceID().token(withAuthorizedEntity: options.gcmSenderID,
scope: InstanceIDScopeFirebaseMessaging,
options: ["apns_token": deviceToken])
{ (token, error) in
// handle token and error
}
}