-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Url scheme’s for Desktop #27
Comments
Good explanations |
This is interesting aspect too https://help.twixlmedia.com/hc/en-us/articles/115000739265-Using-custom-URL-Schemes-in-your-app Using the url schemes to trigger things in the app or it seems to deep link into sone part of your app. |
The feature you mentioned sounds nice. However, implementing it will likely require modifying the gio and gigio libraries, which cannot be done on a third-party library. Additionally, changes to the manifest or plist files may be necessary on iOS, Android and macOS. This means that initially, only basic support for Linux and Windows as a "plugin" may be possible. However, since we are changing gio/gogio: it may be possible to handle "deep links" (which are URLs that support HTTP/HTTPS) and are similar in nature. It might be beneficial to implement both features (custom schemes and deep links) together. |
thanks @inkeliz for your expertise on this. Yep needs work on he GIo side, so I raised an issue on the GIO list at https://todo.sr.ht/~eliasnaur/gio/470 to get the ball rolling. I agree that Deep Links and File handlers ( if that's a good name for it ) have some crossover and it would be awesome to have both in GIO. |
Hey @inkeliz i put together a darwin / ios sample of this. I was wondering if i can PR it on a branch ? |
also because there is some forking of gio should we establish that fork somewhere so that all code can use it ? |
I think is fine to PR. That will also make easier to understand what kind of changes need to apply to Gio. 👍 |
I think we can make it work for browsers too. so when you put it into the browser it opens the local app, or the web site if the local app is not installed. we need proper packaging for mac and windows for this to work too. |
That feature is a "pre-requisite" to implement "OAuth" (SignIn with {Google/Microsoft/Apple/Facebook/WeChat}). Exists two strategies that can be applied:
In both cases PKCE is recommended for security. Exists another strategy, which is the app listen the some custom server (non-Oauth) and execute the login as Web, then the server (non-OAuth server) notifies the user. But that requires more setup. Since I'm working with |
Hey @inkeliz sorry i got stuck on the PR, and side tracked into other work. The plan you have sounds awesome. If i can help with any of it please tell me, as i have some time at the moment. Also you mentioned the GOGIO cmd needing work; I have to modify GOGIO anyway in order to get proper web manifest for Web push notifications. Is this aligned with what we need for Url Scheme, deep link ? Basically a proper Web manifest and service worker right ? |
I'm currently (kind of) designing the API. The major issues, currently is:
The implementation for Android is done (but, requires to modify the manifest manually, on gogio soruce-code, currently). The implementation for MacOS is almost done, and iOS should work by luck, I didn't test. The Windows is the next, but have that "undefined behaviour" of multiple same app opened. |
about windows opening the same app twice… I don’t have windows so can’t confirm but assuming your right then i aspect we let it happen ( if that how windows apps operate , or we use a config file to track open files of the file extension. If a 2nd attempts to open the same file we close and “ redirect “ to the already opened one. This is just a brain storm idea as an alternative to ipc. |
I plan to put up a fork with lots of automation / ci for gio-plugins. So if you like it it can be PRed to your repo. will let you know when that’s ready and you can have a look |
df63942 that change adds support for Android/Windows. But, iOS/macOS needs to be upstream (Gio-core). So, I'm moving everything to Gio-core, but the Windows situation is quite tricky. Because even using IPC it needs to be done before Gio inits, otherwise it will show display some random UI and then close. Let's see what Elias will suggest. You can PR anytime. :) |
On Android, gogio must be patched: diff --git a/gogio/androidbuild.go b/gogio/androidbuild.go
index cddba99..72d1d04 100644
--- a/gogio/androidbuild.go
+++ b/gogio/androidbuild.go
@@ -462,12 +462,24 @@ func exeAndroid(tmpDir string, tools *androidTools, bi *buildInfo, extraJars, pe
android:theme="@style/Theme.GioApp"
android:configChanges="screenSize|screenLayout|smallestScreenSize|orientation|keyboardHidden"
android:windowSoftInputMode="adjustResize"
+ android:launchMode="singleTask"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
+ <activity android:name="com.inkeliz.deeplink.deeplink_android"
+ android:label="com.inkeliz.deeplink.deeplink_android"
+ android:noHistory="true"
+ android:launchMode="singleInstance">
+ <intent-filter>
+ <action android:name="android.intent.action.VIEW"></action>
+ <category android:name="android.intent.category.DEFAULT"></category>
+ <category android:name="android.intent.category.BROWSABLE"></category>
+ <data android:scheme="yourscheme"></data>
+ </intent-filter>
+ </activity>
</application>
</manifest>`)
var manifestBuffer bytes.Buffer |
This looks really good. I will try out the the deep links code and PR anything i see that can help. Also since we have to change some things in gogio, could you let me know where your fork of gioio repo is ? thanks |
I didn't fork it, because Since I'm moving it to Gio, you can track it here: gioui/gio-cmd#9 (and another PR is coming to gioui/gio) |
Ok make sense now - thanks for the update. |
While testing iOS, I notice one "bug": https://stackoverflow.com/questions/42839716/ios-tel-and-mailto-links-only-work-with-target-blank For some reason, |
Curious what happens when the user just types it into safari omni bar and it tries to open the installed app that matches the url scheme … |
If you type into Safari's address bar it works fine, just the HTML (without _blank) doesn't work. I push this feature to Gio: It's finished. But, maybe will take some couple of weeks to get it into Gio-core, if that get accepted. |
I will try it off the githash on your PR’s. This is really cool @inkeliz |
associate a file type with my gio app. So that when the user double clicks the file, it opens my gio app.
*Describe alternatives you've considered
none.
Additional context
seen it also work for web URLs on desktop and mobile … seems to be useful only when you also have a web app ?
https://stackoverflow.com/questions/67400225/handling-url-schemes-with-golang
example code for max and desktop
scraly/learning-go-by-examples#7
The text was updated successfully, but these errors were encountered: