you're not setting device token to FCM system
func application(
_ application: UIApplication,
didRegisterForRemoteNotifeicationsWithDeviceToken deviceToken: Data
) {
Messaging.messaging().apnsToken = deviceToken
}
and in didFinishLaunching method
...
UNUserNotificationCenter.current().delegate = self
let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
UNUserNotificationCenter.current().requestAuthorization(options: authOptions) { granted, error in
print("Notification permission granted: \(granted)")
}
Messaging.messaging().delegate = self
....
I'm always using in this order, I think it will work, please let me know after trying
edit:
and, the main problem in here is that
However, if you have disabled swizzling by setting
* `FirebaseAppDelegateProxyEnabled` to `NO` in your app's
* Info.plist, you should manually set the APNs token in your application
* delegate's `application(_:didRegisterForRemoteNotificationsWithDeviceToken:)`
* method.
As far as I get you touched your info.plist file to set FirebaseAppDelegateProxyEnable
key to set it false, if you did it, you have to manually set it apnsToken like the code I've shared