18.4 C
New York
Monday, March 10, 2025

Flutter app_links not detecting deep hyperlinks when MobileMessaging is put in on iOS


I’m utilizing the app_links bundle to deal with deep hyperlinks in my Flutter app, and it really works completely on iOS. Nonetheless, once I combine the MobileMessaging SDK and name MobileMessagingPluginApplicationDelegate.set up() in AppDelegate.swift, deep hyperlinks cease being detected.

Right here is my delegate file

import Flutter
import UIKit
import app_links
import MobileMessaging
import FBSDKCoreKit

@important
@objc class AppDelegate: FlutterAppDelegate {

    override func software(
        _ software: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
        GeneratedPluginRegistrant.register(with: self)

        // Deal with deep hyperlinks
        if let url = AppLinks.shared.getLink(launchOptions: launchOptions) {
            AppLinks.shared.handleLink(url: url)
        //additionally strive return true right here
        }

        // Initialize Cell Messaging
        MobileMessagingPluginApplicationDelegate.set up()

        // Initialize Fb SDK
        ApplicationDelegate.shared.software(
            software,
            didFinishLaunchingWithOptions: launchOptions
        )

        return tremendous.software(software, didFinishLaunchingWithOptions: launchOptions)
    }

    override func software(
        _ app: UIApplication,
        open url: URL,
        choices: [UIApplication.OpenURLOptionsKey : Any] = [:]
    ) -> Bool {
        // Deal with Fb deep hyperlinks
        return ApplicationDelegate.shared.software(
            app,
            open: url,
            choices: choices
        )
    }
}

I set the FlutterDeepLinkingEnabled to false in plist file.

In the primary widget i set the stream and pay attention for hyperlinks as circulation

_linkSubscription = AppLinks().uriLinkStream.pay attention((uri) {
  print('onAppLink: $uri');
  print("Path ${uri.toString()}");
  if (webViewController != null) {
    webViewController!.loadUrl(urlRequest: URLRequest(url: WebUri(widget.initialUrl + uri.path)));
  }
});

Can’t catch the hyperlinks with this implementation.

  1. How can I make app_links work alongside MobileMessaging?
  2. Is there a approach to make sure MobileMessaging doesn’t block deep hyperlinks?
  3. Ought to app_links be initialized in another way to keep away from conflicts?
  4. Has anybody encountered this problem, and what workarounds exist?

🔹 Any insights or options can be significantly appreciated! 🚀
Thanks prematurely! 🙌

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles