HomeiOS Developmentios - Swift 6 Sendable error in Firebase Messaging

ios – Swift 6 Sendable error in Firebase Messaging


I get the under error in iOS26

Non-Sendable parameter kind ‘[AnyHashable : Any]’ can’t be despatched from caller of protocol requirement ‘software(_:didReceiveRemoteNotification:)’ into important actor-isolated implementation; that is an error within the Swift 6 language mode

On the under code for including Firebase Messaging to my app. The code labored with no error previous to iOS 26. Can anybody help with find out how to do away with this error?

func software(_ software: UIApplication,
                   didReceiveRemoteNotification userInfo: [AnyHashable: Any]) async
    -> UIBackgroundFetchResult {
    // If you're receiving a notification message whereas your app is within the background,
    // this callback is not going to be fired until the consumer faucets on the notification launching the applying.
    // TODO: Deal with information of notification

    // With swizzling disabled you need to let Messaging know in regards to the message, for Analytics
    // Messaging.messaging().appDidReceiveMessage(userInfo)

    // Print message ID.
    if let messageID = userInfo[gcmMessageIDKey] {
      print("Message ID: (messageID)")
    }

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments