llfbandit / app_links

Android App Links, Deep Links, iOs Universal Links and Custom URL schemes handler for Flutter.
https://pub.dev/packages/app_links
Apache License 2.0
176 stars 68 forks source link

App links on macos not working with Flutter version 3.16.0 #82

Closed alihassan143 closed 7 months ago

alihassan143 commented 7 months ago

Describe the bug

A clear and concise description of what the bug is.

Does it related to

[ ] App Links (Android)
[ ] Deep Links (Android)
[x ] Universal Links (iOS)
[x] or Custom URL schemes? (iOS)

Does the example project work?

[ ] Yes
[x ] No
[ ] Irrelevant here

Did you fully read the instructions for the targeted platform before submitting this issue?

Uploaded your files to webserver, HTTPS, direct connection, scheme pattern setup, ...

[x ] Yes
[ ] No
[ ] Irrelevant here

KristijanMitrik commented 7 months ago

@alihassan143 same here, did you found a solution?

KM9668 commented 7 months ago

@llfbandit any idea what can be the problem here?

alihassan143 commented 7 months ago

just downgrade to v3.13.8

alihassan143 commented 7 months ago

@llfbandit any idea what can be the problem here?

i don't know i tried with platform channels also but that also did'nt worked

alihassan143 commented 7 months ago

i tried on v 3.13.9 but did not worked but it working on v.13.8

isinghmitesh commented 7 months ago

my bad I moved to use protocol_handler on v3.13.9

i tried on v 3.13.9 but did not worked but it working on v.13.8

killik-dan-stubbs commented 7 months ago

Can confirm, I am having the same issue on v3.16.0.

spacedevin commented 7 months ago

I switched to protocol_handler for 3.16.0 and modified AppDelegate for now.

https://github.com/knoeone/soundsetr/blob/main/macos/Runner/AppDelegate.swift#L14

  override func applicationWillFinishLaunching(_ notification: Notification) {
    super.applicationWillFinishLaunching(notification)
      NSAppleEventManager.shared().setEventHandler(self, andSelector:#selector(handleURLEvent(_:with:)), forEventClass: AEEventClass(kInternetEventClass), andEventID: AEEventID(kAEGetURL))
  }

  @objc public func handleURLEvent(_ event: NSAppleEventDescriptor, with replyEvent: NSAppleEventDescriptor) {
    guard let urlString = event.paramDescriptor(forKeyword: AEKeyword(keyDirectObject))?.stringValue else { return }

      let window = self.mainFlutterWindow?.contentViewController as! MacOSWindowUtilsViewController
    let messenger = window.flutterViewController.engine.binaryMessenger
    let channel = FlutterMethodChannel(name: "protocol_handler", binaryMessenger: messenger)
    let args: NSDictionary = [
        "url": urlString,
    ]
    channel.invokeMethod("onProtocolUrlReceived", arguments: args)
  }
llfbandit commented 7 months ago

This should be fixed in app_links 3.5.0-beta.1. Feedback appreciated!

alihassan143 commented 7 months ago
Screenshot 2023-11-30 at 5 06 49 PM

@llfbandit getting error on beta

llfbandit commented 7 months ago

Yep, sorry about this. beta.2 has been published.

alihassan143 commented 7 months ago

@llfbandit i just checked example its working let me check on my project

killik-dan-stubbs commented 7 months ago

I can confirm links are working again on MacOS in beta.2 😀

alihassan143 commented 7 months ago

@llfbandit its working

llfbandit commented 7 months ago

Thanks for the feebacks.

dshukertjr commented 7 months ago

Hi @llfbandit

Would there be a stable version release for this fix soon?