iOS Quick Start
Get MovableInk deeplinking working in your iOS app in under 5 minutes.
Prerequisites
Before you begin, ensure you have:
- [x] Your MovableInk subdomain (e.g.,
mi.yourcompany.com) - [x] AASA file configured by MovableInk at
https://mi.yourcompany.com/.well-known/apple-app-site-association - [x] iOS 13.0 or later as your deployment target
- [x] Xcode 14 or later
Need Help?
If you don't have these prerequisites, see the Getting Started guide or contact your Movable Ink client experience team.
Step 1: Install the SDK (1 minute)
Choose your preferred package manager:
Step 2: Configure Universal Links (2 minutes)
Add Associated Domains
- Open your project in Xcode
- Select your app target
- Go to Signing & Capabilities tab
- Click + Capability and add Associated Domains
- Add your MovableInk subdomain in the format:
Replace yourcompany.com with your actual MovableInk subdomain.
Update Info.plist
Add your MovableInk domain to Info.plist:
Note
Replace mi.yourcompany.com with your actual MovableInk subdomain (without https://).
Step 3: Initialize and Handle Links (2 minutes)
For SwiftUI Apps
In your App file:
import SwiftUI
import MovableInk
@main
struct YourApp: App {
var body: some Scene {
WindowGroup {
ContentView()
.onContinueUserActivity(NSUserActivityTypeBrowsingWeb) { userActivity in
guard let url = userActivity.webpageURL else { return }
MIClient.resolveURL(url) { result in
switch result {
case .success(let resolvedURL):
// Navigate to the resolved URL in your app
print("Deeplink resolved to: \(resolvedURL)")
// TODO: Navigate to appropriate screen
case .failure(let error):
print("Failed to resolve link: \(error)")
}
}
}
}
}
}
For UIKit Apps
In your AppDelegate.swift or SceneDelegate.swift:
import MovableInk
// In AppDelegate.swift
func application(
_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
) -> Bool {
guard userActivity.activityType == NSUserActivityTypeBrowsingWeb,
let url = userActivity.webpageURL else {
return false
}
MIClient.resolveURL(url) { result in
switch result {
case .success(let resolvedURL):
// Navigate to the resolved URL in your app
print("Deeplink resolved to: \(resolvedURL)")
// TODO: Navigate to appropriate screen
case .failure(let error):
print("Failed to resolve link: \(error)")
}
}
return true
}
Step 4: Verify It Works
Build and Run
- Build and run your app on a device or simulator (iOS 13+)
- Make sure your app is in the background or closed
Test with a Sample Link
Ask your MovableInk team for a test deeplink, or use this format:
What to Look For
- Open the test link in Safari on your device/simulator
- Your app should open automatically
- Check the Xcode console for the resolved URL:
It Works!
If you see the resolved URL in the console, congratulations! Your basic deeplinking integration is working.
Troubleshooting
If your app doesn't open:
- Verify your AASA file is accessible at
https://mi.yourcompany.com/.well-known/apple-app-site-association - Check that your Associated Domains match exactly (no wildcards, no
https://) - Ensure you're testing on iOS 13+
- Try uninstalling and reinstalling your app to refresh the AASA cache
Next Steps
Now that you have basic deeplinking working, you can:
Implement Navigation
Update the TODO in your code to actually navigate to the appropriate screen based on the resolved URL:
case .success(let resolvedURL):
// Parse the URL and navigate
if resolvedURL.path.contains("/products/") {
// Navigate to product detail screen
} else if resolvedURL.path.contains("/categories/") {
// Navigate to category screen
}
Add Behavior Events
Capture user interactions to power personalized marketing:
Explore Advanced Features
- Deferred Deeplinking - Handle links for new app installs
- In-App Messages - Display HTML content in your app
- Advanced Features - Custom link handling, clipboard, and more