A simple SwiftUI app demonstrating all features of the LinkForty iOS SDK.
- ✅ SDK initialization with configuration
- ✅ Install attribution tracking
- ✅ Deferred deep link handling (install attribution)
- ✅ Direct deep link handling (Universal Links)
- ✅ Event tracking
- ✅ Revenue tracking
- ✅ Event queue management
- ✅ Programmatic link creation
- ✅ Data management (clear/reset)
- LinkForty Backend: You need a running LinkForty backend (Core or Cloud)
- API Key: Get your API key from your LinkForty dashboard (or omit for self-hosted Core)
-
Open the project:
cd Examples/BasicExample open BasicExample.xcodeproj -
Update the API configuration in
BasicExampleApp.swift:let config = LinkFortyConfig( baseURL: URL(string: "https://your-linkforty-instance.com")!, apiKey: "your-api-key-here", // Optional for self-hosted debug: true )
-
For Universal Links (optional):
- Enable "Associated Domains" capability
- Add your domain:
applinks:your-linkforty-instance.com - Ensure your backend serves the AASA file
-
Run the app on a device or simulator
- Create a short link in your LinkForty dashboard
- Open the link in Safari on your device
- If the app is not installed, install it from Xcode
- On first launch, the deferred deep link callback will fire
- Check the "Deep Link Data" section in the app
- With the app installed, create a short link
- Open the link in Safari
- The app should open automatically
- Check the "Deep Link Data" section for the parsed data
- Tap "Create Short Link" in the Link Creation section
- The created URL and short code will appear below the button
- Share the URL or open it in Safari to test the deep link flow
Use the buttons in the app to:
- Track button clicks
- Track page views
- Track revenue
- Flush the event queue
- Clear all data
Monitor the Xcode console for SDK logs (when debug: true).
BasicExample/
├── BasicExampleApp.swift # Main app entry point & SDK initialization
├── ContentView.swift # Main UI with all SDK features
└── README.md # This file
BasicExampleApp.swift
- Initializes the SDK on app launch
- Registers deep link callbacks
- Contains
AppStatefor managing SDK state
ContentView.swift
- Displays SDK status and attribution info
- Provides buttons for testing all SDK features
- Shows deep link data when received
- Check that your
baseURLis correct - Verify your API key (if using LinkForty Cloud)
- Ensure your backend is running and accessible
- Check Xcode console for error messages
- Verify Associated Domains are configured
- Check AASA file is served at
https://yourdomain.com/.well-known/apple-app-site-association - Test AASA file with Apple's validator: https://search.developer.apple.com/appsearch-validation-tool
- Ensure app is installed via Xcode or TestFlight (not debug builds for production links)
- Verify SDK is initialized (
isInitialized == true) - Check that
installIdis present - Look for error messages in console
- Try flushing the event queue manually
For issues or questions:
- Open an issue: https://github.com/LinkForty/mobile-sdk-ios/issues
- Check docs: https://docs.linkforty.com