SDK setup
Save a JSON payload on your website, then receive it when your iOS app opens, including after installation. Use the same application ID in both SDKs.
Get your application ID from the dashboard. Choose the web SDK and one app SDK below.
Web: save a payload
npm install deeplinkitRun this in the visitor’s browser before sending them to your app or the App Store:
import { Deeplinkit } from 'deeplinkit';
const sdk = new Deeplinkit({ applicationId: 'YOUR_APP_ID' });
await sdk.linkVisit({
payload: { productId: '123' },
});
// Continue to your app or App Store listing.Add an optional key to group visits against the same link. The first payload saved for a key is retained; use a new key for different data.
Swift: receive a payload
Requires iOS 15 or later. In Xcode, choose File → Add Package Dependencies and enter:
https://github.com/paulxuca/deeplinkit-spmAdd the deeplinkit product to your app target and rebuild. Start listening when your app’s navigation is ready:
import Deeplinkit
let sdk = Deeplinkit(applicationId: "YOUR_APP_ID")
let unsubscribe = sdk.onLink(onError: { error in
print(error)
}) { payload in
// Navigate using your payload.
}Keep sdk and unsubscribe alive while listening. Call unsubscribe() when finished.
React Native: receive a payload
Requires iOS 15.1 or later and a native build. Expo Go is not supported. Android does not deliver links yet.
npm install deeplinkit-react-native
npx pod-installRebuild your iOS app. Configure once at startup, then subscribe when your app’s navigation is ready:
import { configure, onLink } from 'deeplinkit-react-native';
await configure({ applicationId: 'YOUR_APP_ID' });
const unsubscribe = onLink(payload => {
// Navigate using your payload.
}, error => {
console.error(error);
});
// Call unsubscribe() when finished.Both app SDKs listen on launch and after returning from the background. Route after authentication and navigation are ready.
Test your integration
- Open your website on a physical iPhone and save a test payload.
- Open your app on the same device and check the callback receives the expected JSON.
- Repeat with your app initially uninstalled to test delivery after an App Store install.
- Check the visit and app open in the dashboard.
A visit does not always produce a match. Handle errors and let people continue normally when no payload arrives. Keep backend credentials out of browser and app code.