iOS Getting Started
Everything you need to install the iOS SDK, wire it to your project, and validate the flow.
What are the prerequisites?
Development Environment
- Xcode 15+ and iOS 13+ deployment target
- URL scheme for your app (e.g.
myapp)
ULink Account Setup
- ULink account and project (create one here)
- API key generated from Dashboard → Settings → API Keys → Generate API Key
- Domain configured in your project (Domains → Add Domain)
How to install the SDK?
Swift Package Manager
- File → Add Packages…
- URL:
https://github.com/mohn93/ios_ulink_sdk.git - Select the latest release (e.g.
1.0.6) and add theULinkSDKproduct to your target.
CocoaPods
platform :ios, '13.0'
use_frameworks!
target 'YourApp' do
pod 'ULinkSDK', '~> 1.0.6'
end
Run pod install.
How to configure URL Schemes and Universal Links?
Before initializing the SDK, you need to configure your app to handle incoming links. iOS supports two types of deep links:
- URL Schemes (e.g.,
myapp://) - Custom URL schemes that always open your app - Universal Links (e.g.,
https://yourdomain.com) - HTTPS links that open your app when installed, or fall back to Safari
Step 1: Configure URL Scheme
URL schemes allow your app to be opened via custom URLs like myapp://path/to/content.
- Open your project in Xcode
- Select your app target in the project navigator
- Go to the Info tab
- Scroll down to URL Types section
- Click the + button to add a new URL Type
- Fill in the following:
- Identifier:
com.yourapp.deeplink(use your app's bundle identifier) - URL Schemes: Enter your scheme (e.g.,
myapp- this will create URLs likemyapp://) - Role:
Editor
- Identifier:
- Use lowercase letters and numbers only
- Keep it short and memorable (e.g.,
myapp,shop,news) - Avoid special characters or spaces
Step 2: Configure Universal Links (Recommended)
Universal links work better for sharing because they work even when the app isn't installed. They require setting up Associated Domains.
- In Xcode, select your app target
- Go to the Signing & Capabilities tab
- Click + Capability and select Associated Domains
- Click + under Domains to add a new domain
- Enter your domain in the format:
applinks:yourdomain.comorapplinks:links.shared.ly- Replace
yourdomain.comwith the domain you configured in the ULink dashboard - The
applinks:prefix is required by iOS - For shared domains, use:
applinks:links.shared.ly(or your custom subdomain)
- Replace
The domain you add here must match exactly with the domain configured in your ULink dashboard under Domains. If you're using a shared domain like links.shared.ly, make sure it's added in both places.
Step 3: Add URL Handling to AppDelegate
Your app needs to forward incoming URLs to the ULink SDK. Add these methods to your AppDelegate:
import ULinkSDK
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
) -> Bool {
// Initialize ULink SDK
Task {
do {
let _ = try await ULink.initialize(
config: ULinkConfig(
apiKey: "ULINK_API_KEY",
baseUrl: "https://api.ulink.ly",
debug: true
)
)
} catch {
print("Failed to initialize ULink: \(error)")
}
}
return true
}
// Handle custom URL schemes (e.g., myapp://)
func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]
) -> Bool {
return ULink.shared.handleIncomingURL(url)
}
// Handle universal links (e.g., https://yourdomain.com)
func application(
_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
) -> Bool {
guard userActivity.activityType == NSUserActivityTypeBrowsingWeb,
let url = userActivity.webpageURL else {
return false
}
return ULink.shared.handleIncomingURL(url)
}
}
If you're using SwiftUI with @main and App, you can handle URLs using the .onOpenURL modifier instead. See the Receive Links guide for SwiftUI examples.
How to configure Dashboard Settings?
Now that your app is configured, you need to match those settings in the ULink dashboard. These settings are required for ULink to generate the Apple App Site Association (AASA) file that enables Universal Links.
Bundle Identifier
Your Bundle Identifier uniquely identifies your app to Apple and must match exactly between Xcode and the ULink dashboard.
- In Xcode, select your project in the navigator
- Select your app target
- Go to the General tab
- Find the Bundle Identifier field (e.g.,
com.yourcompany.yourapp) - In the ULink dashboard, go to Configuration → General → iOS
- Enter your Bundle Identifier in the Bundle ID field
Team ID
Your Apple Developer Team ID is required for Universal Links to work. ULink uses it to generate the AASA file in the format TEAM_ID.bundle_id.
Find your Team ID:
- Go to Apple Developer Portal
- Sign in with your Apple Developer account
- Navigate to Membership in the left sidebar
- Copy your Team ID (a 10-character alphanumeric string like
ABC123DEF4)
Add to ULink dashboard:
- In the ULink dashboard, go to Configuration → General → iOS
- Enter your Team ID in the Team ID field
You can also find your Team ID in Xcode:
- Open your project in Xcode
- Select your project in the navigator
- Select your target → Signing & Capabilities tab
- Look at your Team dropdown — the Team ID appears in parentheses next to the team name
- Alternatively, check your provisioning profile details in the Signing section
URL Scheme
Enter the URL scheme you configured earlier (Step 1) without the :// suffix.
- In the ULink dashboard, go to Configuration → General → iOS
- Enter your URL Scheme (e.g.,
myapp— notmyapp://)
Domain Configuration
- Navigate to the Domains section in your project
- If you haven't already, add your domain:
- For shared domains: Click Add Domain → Select Shared Domain (.shared.ly) → Enter your subdomain
- For custom domains: Click Add Domain → Enter your custom domain → Complete DNS verification
- Ensure the domain matches exactly what you entered in Associated Domains (without the
applinks:prefix)
- The Bundle ID in the dashboard must match your Xcode project's bundle identifier
- The Team ID in the dashboard must match your Apple Developer Team ID
- The URL Scheme in the dashboard must match the scheme you added in URL Types
- The Domain in the dashboard must match the domain in your Associated Domains (without the
applinks:prefix)
If any of these don't match, Universal Links won't work and links will open in Safari instead of your app.
Frequently Asked Questions (FAQ)
How do I verify the integration?
- Navigate to Links → Create Link.
- Choose Unified for App Store/website routing or Dynamic for deep link parameters.
- Set a short Slug, iOS URL, and Fallback URL.
- Save the link and copy the short URL.
- Install a build containing the ULink SDK on your device.
- Tap the short URL from Notes or email.
- If installed, the app should launch and receive data.
- If missing, it should redirect to the fallback URL.
Where can I see analytics?
In Links, confirm the click counter increments. Click the Analytics button for that specific link to open its analytics page and ensure the platform is iOS.
What if deep links aren't working?
If metrics don't update or the app doesn't open, review Troubleshoot & Test Deep Links for debugging tips.
How can I verify my configuration with the CLI?
The ULink CLI provides comprehensive verification of your Universal Links setup.
Install the CLI
# macOS / Linux
curl -fsSL https://ulink.ly/install.sh | bash
# Windows (PowerShell)
irm https://ulink.ly/install.ps1 | iex
Run Verification
# Authenticate
ulink login
# Link your project
cd /path/to/your/ios-app
ulink project set
# Run verification
ulink verify -v
What the CLI Verifies
| Check | Description |
|---|---|
| Info.plist | Validates URL schemes (CFBundleURLTypes) |
| Bundle ID | Confirms bundle identifier is configured |
| Entitlements | Checks for entitlements file existence |
| Associated Domains | Validates applinks entries in entitlements |
| AASA file | Fetches and validates /.well-known/apple-app-site-association |
| Team ID matching | Verifies Team ID matches dashboard configuration |
Fixing Issues
The verification report shows exactly what's misconfigured. Common issues:
- Missing associated domains in entitlements
- Bundle ID mismatch between Xcode and dashboard
- Team ID not configured in dashboard
- AASA file not accessible on domain
Run ulink verify after any Xcode signing or capability changes to catch issues early.