Hi folks! Any references for deep links and local ...
# compose-desktop
a
Hi folks! Any references for deep links and local platform notifications with tap to navigate with a notification identifier ?
a
there is an example of deep linking for mac os. local platform notifications are very limited right now. seems like it’s just displaying a message and that’s it
a
thanks @Alex Styl For some reasons it was not working, it started working now 😬, I guess i was executing
desktop:run
and not
desktop:runDistributable
a
if you figure out how to do for windows, do share
a
There’s a flutter library which works for windows.. https://pub.dev/packages/uni_links_desktop
Ideally the native code should work for us too ?
I am planning to look into it this week.. macos and android was my priority for now
a
are you saying that flutter libraries have native code?
never looked into flutter
a
Yes they depend on platform code internally
this should help you! and me 🤞
The equivalent code should look like this, this should register your custom scheme on windows for deeplinking. Using: https://github.com/sarxos/win-registry
Copy code
val reg: WindowsRegistry = WindowsRegistry.getInstance()
            val appExecutablePath = ProcessHandle.current()
    .info()
    .command()
    .orElseThrow();

            val protocolRegKey = "Software\\Classes\\slackclone"
            val protocolCmdRegKey = "shell\\open\\command"

            val regKeyUri = reg.createKey(HKey.HKCU, protocolRegKey);
            val regKeyShellCommand = reg.createKey(HKey.HKCU, protocolCmdRegKey)
            reg.writeStringValue(HKey.HKCU,protocolRegKey,"URL Protocol","")
            reg.writeStringValue(HKey.HKCU,protocolCmdRegKey,"","$appExecutablePath %1")
I don’t have a windows system so cant really test 😬 @Alex Styl
m
You'd have to remember to undo that at uninstall time, so normally you wouldn't write that in kotlin but delegate it to the packaging framework
e.g. in conveyor you'd write
app.url-schemes = [ my-protocol ]
and in other frameworks you'd manually edit the NSIS configuration, perhaps.
a
thanks for mentioning those important steps @mikehearn 🙂