From 3d5750982552f78e249b63d4f9bb6be0d15570c5 Mon Sep 17 00:00:00 2001 From: Preacher999987 Date: Wed, 30 Jul 2025 22:36:28 +0100 Subject: [PATCH 1/2] Clarify swizzling requirement for APNs token registration in AppDelegate --- messaging/MessagingExampleSwift/AppDelegate.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/messaging/MessagingExampleSwift/AppDelegate.swift b/messaging/MessagingExampleSwift/AppDelegate.swift index d47e56f91..8eb1aeb41 100644 --- a/messaging/MessagingExampleSwift/AppDelegate.swift +++ b/messaging/MessagingExampleSwift/AppDelegate.swift @@ -99,8 +99,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate { didFailToRegisterForRemoteNotificationsWithError error: Error) { print("Unable to register for remote notifications: \(error.localizedDescription)") } - - // This function is added here only for debugging purposes, and can be removed if swizzling is enabled. + + // NOTE: When method swizzling is enabled (default), this method must still be explicitly declared. + // Firebase Messaging uses it to intercept and register the APNs device token internally. + // If omitted, the device token will not be received. + // If swizzling is disabled then this function must be implemented so that the APNs token can be paired to // the FCM registration token. func application(_ application: UIApplication, From 1c40c1a237ea7b9b1b17a044a941227aa7851c2f Mon Sep 17 00:00:00 2001 From: Preacher999987 Date: Wed, 30 Jul 2025 23:17:15 +0100 Subject: [PATCH 2/2] fix: Swift file formatting --- messaging/MessagingExampleSwift/AppDelegate.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/messaging/MessagingExampleSwift/AppDelegate.swift b/messaging/MessagingExampleSwift/AppDelegate.swift index 8eb1aeb41..bda526f5c 100644 --- a/messaging/MessagingExampleSwift/AppDelegate.swift +++ b/messaging/MessagingExampleSwift/AppDelegate.swift @@ -99,11 +99,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate { didFailToRegisterForRemoteNotificationsWithError error: Error) { print("Unable to register for remote notifications: \(error.localizedDescription)") } - + // NOTE: When method swizzling is enabled (default), this method must still be explicitly declared. // Firebase Messaging uses it to intercept and register the APNs device token internally. // If omitted, the device token will not be received. - // If swizzling is disabled then this function must be implemented so that the APNs token can be paired to // the FCM registration token. func application(_ application: UIApplication,