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.
- How can I make app_links work alongside MobileMessaging?
- Is there a approach to make sure MobileMessaging doesn’t block deep hyperlinks?
- Ought to app_links be initialized in another way to keep away from conflicts?
- Has anybody encountered this problem, and what workarounds exist?
🔹 Any insights or options can be significantly appreciated! 🚀
Thanks prematurely! 🙌