Skip to content

fix: flavor-specific deep link config to eliminate dev/prod chooser dialog #4756

Closed as not planned

Description

@beastoin

Problem

When both Omi (prod) and Omi Dev (dev) are installed on the same device, Android shows a disambiguation ("chooser") dialog for every deep link — h.omi.me URLs, omi:// scheme links, and OAuth callbacks. The user must manually pick which app handles the link every time.

Root cause: Both flavors register identical deep link config in a single shared AndroidManifest.xml:

  • Same custom scheme: omi://
  • Same domains: h.omi.me, try.omi.me
  • Same autoVerify="true" — but assetlinks.json only lists the prod signing key, so dev silently fails verification and falls back to the chooser

There are no flavor-specific manifest overlays (app/android/app/src/prod/ or app/android/app/src/dev/).

On iOS, the same issue exists: apple-app-site-association lists only the prod bundle ID (9536L8KLMP.com.friend-app-with-wearable.ios12), so Universal Links never fire for dev builds — they always open in Safari.

Proposed solution

Android

Create flavor-specific AndroidManifest.xml overlays:

app/android/app/src/prod/AndroidManifest.xml
  → host: h.omi.me, try.omi.me
  → scheme: omi

app/android/app/src/dev/AndroidManifest.xml
  → host: dev.h.omi.me (or similar dev subdomain)
  → scheme: omi-dev

Gradle merges these at build time. Prod builds only claim prod domains; dev builds only claim dev domains. No more chooser dialog.

iOS

  • Host dev.h.omi.me/.well-known/apple-app-site-association with the dev bundle ID + team ID
  • Update Info.plist associated domains per build config (prod → h.omi.me, dev → dev.h.omi.me)

Flutter (app_shell.dart)

No changes needed — app_links package already handles both schemes transparently. The route handler (openAppLink) parses path segments, not scheme/host.

OAuth callbacks

Update auth_service.dart redirect URI:

  • Prod: omi://auth/callback
  • Dev: omi-dev://auth/callback

Read from a config/env constant so the backend knows which redirect URI to accept per environment.

Files to change

File Change
app/android/app/src/prod/AndroidManifest.xml New — prod intent filters (moved from main)
app/android/app/src/dev/AndroidManifest.xml New — dev intent filters with dev domain/scheme
app/android/app/src/main/AndroidManifest.xml Remove deep link intent filters (now in flavor overlays)
app/ios/Runner/Info.plist Conditionally set associated domains per build config
web/ or DNS Host dev.h.omi.me with dev AASA + assetlinks
app/lib/services/auth_service.dart Read scheme from config for OAuth redirect URI

Context

Discovered during PR #4737 (task sharing deep links). Adding /tasks intent filters made the chooser appear for the new route too. Every future deep link feature (#4724 forward/share, conversation sharing, etc.) will hit the same problem until this is fixed.

Related: #4724, #4727

Activity

  1. added
    ux-polish
    maintainer
    p2
    on Feb 12, 2026
  2. beastoin commented on Feb 12, 2026

    @beastoin
    CollaboratorAuthor

    Additional finding: omi:// scheme has no host restriction

    From @kenji's deep link audit — AndroidManifest.xml:151-156:

    <intent-filter>
        <data android:scheme="omi" />
    </intent-filter>

    No android:host specified, so any omi://* URL opens the app — including potentially crafted links from malicious sources. While the app validates OAuth state parameters, broadening the scheme to accept any host is unnecessary.

    Fix (part of the flavor-specific config in this issue):

    • Prod: <data android:scheme="omi" android:host="h.omi.me" />
    • Dev: <data android:scheme="omi-dev" android:host="hdev.omi.me" />

    This restricts the custom scheme to known hosts only.

    @Chen (RepoOps), from @kenji's audit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintainerp2ux-polish

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions