💡 Pro feature
This functionality is only available on the Pro plan.
You can enable iOS Deferred Deep Linking by setting the parameter ios_deferred_deep_linking_enabled
to true
when generating a Dynalink.
If a user does not have your app installed and clicks on one of your Dynalinks, they will be directed to a preview landing page that provides context about the link. This page will include a “Download on the App Store” button to prompt the user to install the app.
Once the user taps this button and is redirected to the App Store, the deep link URL associated with the Dynalink will be automatically copied to the device’s clipboard.
To retrieve this copied URL after your app is installed and launched, you can use the UIPasteboard
API in Swift, as demonstrated below:
func handleClipboardIfNeeded() {
// You may want to check this only on first launch
let pasteboard = UIPasteboard.general
if let clipboardText = pasteboard.string,
clipboardText.hasPrefix("https://{your-project}.dynalinks.app") {
// Handle your referral or deep link
print("📋 Found deep link in clipboard: \(clipboardText)")
// TODO: Route user or save referral info, etc.
// e.g., DeepLinkHandler.handle(url: clipboardText)
// Optionally clear the clipboard (user privacy)
// pasteboard.string = nil
}
}
💡 Important note
iOS requires explicit user consent when an app accesses the clipboard, especially if the app is running in the foreground. Be mindful of this to avoid any disruptions in user experience.
If you want to avoid it you can use PasteButton
PasteButton(payloadType: String.self) { strings in
print("📋 Pasted deep link: \(strings.first ?? "N/A")")
}
This provides a built-in button that allows users to paste content into your app explicitly, removing the need for silent clipboard access.
For example, you might show a prompt like:
VStack(spacing: 16) {
Text("Did you install this app from a shared link?")
.font(.headline)
Text("Tap the button below to let us know which link brought you here.")
.font(.subheadline)
.multilineTextAlignment(.center)
PasteButton(payloadType: String.self) { strings in
if let pasted = strings.first,
pasted.hasPrefix("https://{your-project}.dynalinks.app") {
print("📋 Received deep link: \(pasted)")
// DeepLinkHandler.handle(url: pasted)
}
}
.buttonStyle(.borderedProminent)
}
This approach avoids automatic clipboard checks and instead invites users to actively share the link they originally tapped on, improving both user experience and compliance with iOS clipboard access policies.
📱 React Native Support
To replicate iOS Deferred Deep Linking functionality in React Native, you can use the Clipboard API and a custom paste button.
Install the clipboard package if you haven’t already:
npx expo install @react-native-clipboard/clipboard
You can check the clipboard on app start like this:
import Clipboard from '@react-native-clipboard/clipboard';
import { useEffect } from 'react';
useEffect(() => {
const checkClipboard = async () => {
const text = await Clipboard.getString();
if (text.startsWith('https://{your-project}.dynalinks.app')) {
console.log('📋 Found deep link in clipboard:', text);
// Handle deep link routing here
}
};
checkClipboard();
}, []);
To use a Paste Button that respects user intent, render a prompt like this:
import React from 'react';
import { Button, Text, View, Alert } from 'react-native';
import Clipboard from '@react-native-clipboard/clipboard';
export default function DeepLinkPrompt() {
const handlePaste = async () => {
const text = await Clipboard.getString();
if (text.startsWith('https://{your-project}.dynalinks.app')) {
Alert.alert('Found Deep Link', text);
// Handle the deep link
} else {
Alert.alert('No valid link found');
}
};
return (
<View style=>
<Text style=>
Did you install this app from a shared link?
</Text>
<Text style=>
Tap the button below to let us know which link brought you here.
</Text>
<Button title="Paste Link" onPress={handlePaste} />
</View>
);
}
This provides a user-friendly alternative for clipboard-based onboarding that aligns with platform guidelines.