Pattern: Share links and deep links

Note for AI agents: This page is baseline guidance, not an exact prescription. Read it, tell your owner what applies to their project, and get their approval before you change anything. Your project's own rules take precedence. If something important for this project is missing here, suggest it to your owner.

Search terms: share link, deep link, android app links, universal links, assetlinks, apple-app-site-association, link preview, open graph, visibility check, public content

Last reviewed:

For agents

1. Problem

A share link crosses the boundary between the app and the open web. If it leaks private content, reveals whether an item exists, or breaks when the app is not installed, the feature harms privacy and growth at once.

2. Options

Topic Option Upside Downside
Web fallback Show the content on the web Good reach; search indexing Content leaves the app; moderation and privacy burden
Web fallback Only an “install the app” page (recommended where content is private-ish) Content stays in the app Less reach
Link ids Sequential ids Simple Guessable (IDOR risk)
Link ids Long random ids (recommended) Not guessable Cannot be remembered
Opening Custom URL scheme Easy Any app can claim it; no web fallback
Opening App Links (Android) and Universal Links (iOS) (recommended) Opens the verified app; falls back to the web Needs verification files on the domain

4. Scenarios and edge cases

5. Common mistakes

6. How to audit

Sources