You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Protocol Handler not working with flutter version 3.16.0 in Macos #12
Thanks, @spacedevin! Also, if you are not using the macos_window_utils dependency, you will need to modify the handleURLEvent function to look like this:
@objcpublicfunchandleURLEvent(_event:NSAppleEventDescriptor,withreplyEvent:NSAppleEventDescriptor){guardleturlString=event.paramDescriptor(forKeyword:AEKeyword(keyDirectObject))?.stringValueelse{return}
//These two lines are different
guardletwindow=NSApplication.shared.windows.firstelse{return}letcontroller=window.contentViewControlleras!FlutterViewControllerletmessenger=controller.engine.binaryMessengerletchannel=FlutterMethodChannel(name:"protocol_handler",binaryMessenger:messenger)letargs:NSDictionary=["url":urlString,]channel.invokeMethod("onProtocolUrlReceived",arguments:args)}
Activity
cliftonlabrum commentedon Nov 24, 2023
I'm seeing the same issue.
onProtocolUrlReceiveddoesn't get called now.It works fine in iOS.
spacedevin commentedon Nov 27, 2023
Moving the listener to AppDelegate worked for me for now on
3.16.0https://github.com/knoeone/soundsetr/blob/main/macos/Runner/AppDelegate.swift#L14
alihassan143 commentedon Nov 28, 2023
its working but its not the best solution we need to fix this in plugin side
cliftonlabrum commentedon Dec 17, 2023
Thanks, @spacedevin! Also, if you are not using the
macos_window_utilsdependency, you will need to modify thehandleURLEventfunction to look like this: