Sub topic 2
Custom Schemes Versus Verified HTTPS Links
Assume you know basic Dart and Flutter widgets, Flutter navigation, and the parts of a URL: scheme, host, path, and query. You should also be able to build and run an app on Android or iOS. This chapter explains how the operating system decides which app receives a link.
A deep link is a link that opens a specific location inside an app. For example, this link could open product 42:
https://example.com/products/42The operating system delivers the link to the app. Flutter then parses the URI and maps its path to a screen. These are separate steps. A correct Flutter route cannot help if the operating system never delivers the link to your app.
Custom URL schemes
A custom scheme is an app-defined prefix, such as myshop://:
myshop://products/42?ref=emailThe app registers the myshop scheme with Android or iOS. When a user opens this URI, the platform looks for an application that claims the scheme.
Custom schemes are simple and useful for:
- Internal links between apps that you control.
- Development and testing.
- OAuth callbacks, when the identity provider supports them.
- Links that do not need to work in a browser.
They have an important weakness: another installed app can often register the same scheme. The operating system may show a chooser, select another app, or behave differently across platform versions. The scheme does not prove that your organization owns the name.
A custom scheme also has no normal web fallback. If the app is not installed, a browser may not know what to do with myshop://products/42.
Verified HTTPS links
A verified HTTPS link uses a normal web URL, such as:
https://example.com/products/42Android App Links and iOS Universal Links connect this domain to your app. The connection requires configuration on both sides:
- The app declares which HTTPS host and paths it accepts.
- The website publishes a proof that authorizes the app.
- The platform verifies the proof before routing matching links to the app.
On Android, the proof is /.well-known/assetlinks.json. On iOS, it is /.well-known/apple-app-site-association, combined with the Associated Domains entitlement. The later setup chapters cover these files in detail.
Verified HTTPS links are usually the right choice for links users receive in email, chat, search results, or a browser. They can open the app when installed and keep working as web pages when it is not.
| Property | Custom scheme | Verified HTTPS link |
|---|---|---|
| Example | `myshop://products/42` | `https://example.com/products/42` |
| Domain ownership proof | No | Yes |
| Browser fallback | Usually no | Yes |
| Collision risk | Higher | Lower |
| Best use | Private app-to-app callbacks | User-facing shared links |
How delivery works
Choosing the link type
Use verified HTTPS links for public product, account, invitation, and content URLs. Use a custom scheme when you need a controlled callback or a temporary development path. Many production apps support both, but they should route both forms through the same validation and navigation logic.
Exercise
Which link type should a public product link in an email normally use, and why?
Show answer
Use a verified HTTPS link. It can open the installed app, provide a browser fallback, and use domain ownership verification to reduce link collisions.