I am getting the below error in iOS26
Non-Sendable parameter type ‘[AnyHashable : Any]’ cannot be sent from caller of protocol requirement ‘application(_:didReceiveRemoteNotification:)’ into main actor-isolated implementation; this is an error in the Swift 6 language mode
On the below code for adding Firebase Messaging to my app. The code worked with no error prior to iOS 26. Can anyone assist with how to get rid of this error?
func application(_ application: UIApplication,
didReceiveRemoteNotification userInfo: [AnyHashable: Any]) async
-> UIBackgroundFetchResult {
// If you are receiving a notification message while your app is in the background,
// this callback will not be fired till the user taps on the notification launching the application.
// TODO: Handle data of notification
// With swizzling disabled you must let Messaging know about the message, for Analytics
// Print message ID.
if let messageID = userInfo[gcmMessageIDKey] {
print("Message ID: \(messageID)")
}