decentraland / decentraland/bevy-explorer
Sign in on macOS without the Decentraland launcher installed
- Dominant language
- Rust
- Stars
- 27
- Forks
- 20
- Avg merge
- 1d 30m
- Merged PRs (30d)
- 78
Description
The deep-link sign-in (the flow that replaced `dcl_personal_sign`) needs something on the machine to receive `decentraland://` links. On macOS the explorer currently asks the user to install the Decentraland launcher, because only an app bundle can claim a scheme and the URL is delivered as an Apple Event rather than on argv.
Handling it ourselves would mean:
- add `decentraland` to `CFBundleURLTypes` in `deploy/macos/Info.plist` (the bundle already claims an unused `dclbevyexplorer` scheme)
- register a `GURL` Apple Event handler with `NSAppleEventManager` before winit's run loop starts (an objc2 `define_class!` with one selector; objc2 and objc2-foundation are already in the tree via winit), which writes a sign-in link to the launcher bridge file the same way the windows/linux handler process does
- deal with scheme competition: with both us and the launcher claiming `decentraland`, Launch Services picks whichever registered last, and the launcher never reclaims. The polite version calls the deprecated `LSSetDefaultHandlerForURLScheme` on every start, naming the launcher when it is installed and ourselves otherwise. That is fragile and is the main reason this was not done in #1238.
- cold-start place links arrive as an event after the boot location was chosen, so they need the teleport-in-place handling too
There is no working native macOS build to test any of this against right now.
The cleaner end state is our own scheme everywhere: a `deepLink` target-config entry for bevy in decentraland/auth pointing at `dclbevyexplorer://`, registered on every OS without competing with the launcher. That still needs the Apple Event handler on macOS, but removes the competition and the launcher dependency.
Contributor guide
Assessment
This issue has not been assessed yet.