Safari has unique behaviors with Universal Links that differ from other apps (Mail, Messages, Notes). Understanding these behaviors is critical because Safari is where most web-to-app transitions happen, and getting it wrong means users stay in the browser when they should be in your app.
For Universal Links fundamentals, see universal links: everything you need to know. For email-specific behavior, see universal links in email.
The Same-Domain Restriction
The most important Safari-specific behavior: Universal Links do not trigger when the user taps a link to the same domain they are currently on.
| Scenario | Result |
|---|---|
User is on example.com/page1, taps link to example.com/product/123 |
Stays in Safari (no app open) |
User is on google.com, taps link to example.com/product/123 |
Opens the app |
User is on blog.example.com, taps link to example.com/product/123 |
Opens the app (different subdomain) |
This is by design. Apple considers same-domain navigation to be a web browsing continuation, not an app-opening intent.
Workarounds
Use a different domain for deep links:
If your website is example.com, use link.example.com or a custom domain for deep links. Since the domains differ, Safari will trigger Universal Links.
Smart Banner: Use Apple's native Smart App Banner or a custom smart banner on your web pages:
<meta name="apple-itunes-app" content="app-id=123456789, app-argument=yourapp://product/123">
The Smart Banner provides an "Open in App" button that bypasses the same-domain restriction.
JavaScript redirect through a different domain:
// On your website
function openInApp(path) {
window.location.href = `https://link.example.com${path}`;
}
This redirects through a different subdomain, triggering the Universal Link.
User Choice Persistence
When a Universal Link triggers and the app opens, the user sees a breadcrumb in the top-right corner of the app: a small banner showing the website domain. If the user taps this banner (or long-presses a Universal Link and chooses "Open in Safari"), iOS remembers this choice.
The "Open in Safari" Problem
Once a user chooses to open a link in Safari instead of the app, iOS remembers this preference for that domain. All future Universal Links for that domain will open in Safari, not the app.
How to reset: The user can long-press the link and choose "Open in [App Name]" to restore the app-opening behavior.
From the app's perspective: You cannot programmatically override the user's choice. This is an Apple privacy and user-agency decision. However, you can:
- Ensure the first app-open experience is excellent (so users do not want to leave).
- Use the Smart App Banner on your web pages as a fallback for users who have chosen Safari.
- Display an "Open in App" button on your mobile website.
Safari-Specific Behaviors
Long-Press Menu
When a user long-presses a Universal Link in Safari:
| Menu Option | Behavior |
|---|---|
| "Open" | Opens in Safari (same tab) |
| "Open in New Tab" | Opens in Safari (new tab) |
| "Open in [App Name]" | Opens in the app |
| "Add to Reading List" | Saves the URL |
| "Copy Link" | Copies the URL |
The "Open in [App Name]" option only appears if the AASA file is valid and the app is installed.
Private Browsing
Universal Links work in Private Browsing mode. iOS does not change its AASA handling based on browsing mode. However, the same-domain restriction still applies.
JavaScript-Triggered Navigation
Universal Links triggered by JavaScript (window.location.href, window.open()) may not open the app in all cases. Apple's documentation states that Universal Links require a "user action" to trigger:
| Trigger | Opens App? |
|---|---|
User taps an <a> tag |
Yes |
window.location.href from a user-initiated event (click handler) |
Yes (in most cases) |
window.location.href without user interaction (e.g., setTimeout) |
No |
window.open() |
Inconsistent |
<meta http-equiv="refresh"> |
No |
| HTTP 301/302 redirect | Depends on iOS version |
Best practice: Always use standard <a href> links for Universal Links. Avoid JavaScript-based navigation when possible.
iframes
Universal Links do not trigger from within iframes. If your link is inside an iframe, it will open in Safari within the iframe, not in the app.
Handling Safari Fallbacks
When Universal Links do not trigger (same-domain, user choice, JavaScript), users land on your web page. Make this experience good:
Smart App Banner
Add the native Smart App Banner to all pages that could be deep link destinations:
<meta name="apple-itunes-app"
content="app-id=123456789,
app-argument=https://example.com/product/123">
The app-argument is passed to the app when the user taps "Open."
Custom "Open in App" Button
For a more prominent call-to-action:
<div class="open-in-app-banner">
<p>Get a better experience in our app</p>
<a href="https://link.example.com/product/123">Open in App</a>
</div>
Use a different domain (e.g., link.example.com) to ensure the link triggers the Universal Link.
Mobile Web as a Full Fallback
Ensure your mobile web experience is functional. Users who end up in Safari should still be able to:
- View the product.
- Add to cart.
- Complete a purchase.
- Create an account.
The mobile web experience is your safety net for all Universal Link edge cases.
Debugging Safari Behavior
Test in Safari vs Other Apps
| Test | Expected Behavior |
|---|---|
| Tap Universal Link from Messages | Opens app |
| Tap Universal Link from Mail | Opens app |
| Tap Universal Link from Notes | Opens app |
| Tap Universal Link from Safari (different domain) | Opens app |
| Tap Universal Link from Safari (same domain) | Stays in Safari |
If links open the app from Messages but not Safari, the same-domain restriction is the likely cause, not an AASA issue.
Check for User Choice Override
If Universal Links stopped working for a specific user:
- Long-press the link in Safari.
- If "Open in [App Name]" appears in the menu, the AASA is valid.
- Tap "Open in [App Name]" to reset the user's choice.
Tolinku for Safari Deep Links
Tolinku uses a separate domain for deep links (your Tolinku subdomain or custom domain), which avoids Safari's same-domain restriction. When users tap a Tolinku deep link from any context (including your own website in Safari), the link triggers Universal Links because the domain differs from your website domain. For Universal Links configuration, see the Universal Links developer guide.
For web-to-app strategies, see deep linking for web. For the complete Universal Links guide, see universal links: everything you need to know.
Get deep linking tips in your inbox
One email per week. No spam.