No description
Find a file
inkeliz 7bcb315ee1 app: add custom scheme support
Now, it's possible to launch one Gio app using a custom URI scheme, such as `gio://some/data`.

This feature is supported on Android, iOS, macOS and Windows, issuing a new transfer.URLEvent,
containing the URL launched. If the program is already open, one transfer.URLEvent will be
sent to the current  app.

Limitations:
On Windows, if the program listen to schemes (compiled with `-schemes`), then just a single
instance of the app can be open. In other words, just a single `myprogram.exe` can
be active.

Security:
Deeplinking have the same level of security of clipboard. Any other software can send such
information and read the content, without any restriction. That should not be used to transfer
sensible data, and can't be fully trusted.

Setup/Compiling:
In order to set the custom scheme, you need to use the new `-schemes` flag in `gogio`, using
as `-schemes gio` will listen to `gio://`.

If you are not using gogio you need to defined some values, which varies for each OS:

macOS/iOS - You need to define the following Properly List:
```
<key>CFBundleURLTypes</key>
<array>
  <dict>
        <key>CFBundleURLSchemes</key>
        <array>
          <string>yourCustomScheme</string>
        </array>
  </dict>
</array>
```

Windows - You need to compiling using -X argument:
```
-ldflags="-X "gioui.org/app.schemesURI=yourCustomScheme" -H=windowsgui"
```

Android - You need to add IntentFilter in GioActivity:
```
<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="yourCustomScheme"></data>
</intent-filter>
```

That assumes that you still using GioActivity and GioAppDelegate, otherwise more
changes are required.

Events are routed to a new app.Events, which are not linked to a specific window.

Signed-off-by: inkeliz <inkeliz@inkeliz.com>
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2025-12-15 22:20:54 +01:00
.builds go.*: bump Go to 1.23, upgrade dependencies 2025-05-05 19:46:39 +02:00
app app: add custom scheme support 2025-12-15 22:20:54 +01:00
f32 f32: add tests for Affine2D transformations 2025-07-12 09:43:08 +02:00
font [text, font] Bump go-text version to 0.2.1 2024-12-18 13:28:10 -05:00
gesture layout,gesture: add option to handle vertical scroll on horizontal list 2025-05-16 16:52:45 +02:00
gpu gpu/clip: fix vertex corner positions 2025-08-01 21:15:33 +02:00
internal internal/stroke: quickly handle zero length normalization 2025-07-28 21:28:31 +02:00
io all: avoid collides with builtin min/max functions 2025-07-14 10:14:12 +02:00
layout layout: add Values map to Context 2025-06-24 13:45:59 +02:00
op op/clip: add bounds expansion after move 2025-07-16 09:46:32 +02:00
text all: avoid collides with builtin min/max functions 2025-07-14 10:14:12 +02:00
unit unit: add PxToDp and PxToSp 2023-01-01 10:19:50 -06:00
widget all: avoid collides with builtin min/max functions 2025-07-14 10:14:12 +02:00
.gitattributes .gitattributes: disable Windows line ending conversion 2019-12-03 13:36:31 +01:00
flake.lock flake.*: upgrade to nixpkgs 25.05, use nixpkgs android SDK 2025-05-24 11:47:43 +02:00
flake.nix flake.*: upgrade to nixpkgs 25.05, use nixpkgs android SDK 2025-05-24 11:47:43 +02:00
go.mod app: add custom scheme support 2025-12-15 22:20:54 +01:00
go.sum app: add custom scheme support 2025-12-15 22:20:54 +01:00
LICENSE LICENSE: tighten license language 2020-12-11 16:42:04 +01:00
README.md doc: update readme with tag policy 2023-07-01 12:38:39 -04:00

Gio - https://gioui.org

Immediate mode GUI programs in Go for Android, iOS, macOS, Linux, FreeBSD, OpenBSD, Windows, and WebAssembly (experimental).

Installation, examples, documentation

Go to gioui.org.

builds.sr.ht status

Issues

File bugs and TODOs through the issue tracker or send an email to ~eliasnaur/gio@todo.sr.ht. For general discussion, use the mailing list: ~eliasnaur/gio@lists.sr.ht.

Contributing

Post discussion to the mailing list and patches to gio-patches. No Sourcehut account is required and you can post without being subscribed.

See the contribution guide for more details.

An official GitHub mirror is available.

Tags

Pre-1.0 tags are provided for reference only, and do not designate releases with ongoing support. Bugfixes will not be backported to older tags.

Tags follow semantic versioning. In particular, as the major version is zero:

  • breaking API or behavior changes will increment the minor version component.
  • non-breaking changes will increment the patch version component.