https://github.com/appsflyersdk/appsflyer-apple-migration-helper
The AppsFlyerMigrationHelper Module collects attribution and deep linking data given by the developer.
https://github.com/appsflyersdk/appsflyer-apple-migration-helper
Last synced: 9 months ago
JSON representation
The AppsFlyerMigrationHelper Module collects attribution and deep linking data given by the developer.
- Host: GitHub
- URL: https://github.com/appsflyersdk/appsflyer-apple-migration-helper
- Owner: AppsFlyerSDK
- License: other
- Created: 2025-02-23T07:26:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-29T13:04:28.000Z (11 months ago)
- Last Synced: 2025-08-22T10:17:49.522Z (10 months ago)
- Language: Objective-C
- Size: 204 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# iOS Migration Helper
[](https://github.com/AppsFlyerSDK/AppsFlyerMigrationHelper/blob/main/LICENSE)
🛠In order for us to provide optimal support, we would kindly ask you to submit any issues to
support@appsflyer.com
> *When submitting an issue please specify your AppsFlyer sign-up (account) email , your app ID , production steps, logs, code snippets and any additional relevant information.
## Table Of Content
* [This Module is Built for](#plugin-build-for)
* [Adding The Migration Helper To Your Project](#install-connector)
+ [Cocoapods](#cocoapods)
+ [Carthage](#carthage)
+ [SPM](#spm)
* [Basic Integration Of The Helper tool](#basic-integration)
+ [Set Attribution parameters](#set-attribution-parameters)
+ [Set DeepLink parameters](#set-deeplink-parameters)
## This Module is Built for
- AppsFlyer SDK:
• 6.16.2+
- Minimum iOS Version: 12
More reference on Carthage binary artifacts integration [here](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md).
1. In Xcode, go to File > Swift Packages > Add Package Dependency.
2. Enter the repository URL:
```
https://github.com/AppsFlyerSDK/appsflyer-apple-migration-helper
```
3. Choose the desired version or branch.
4. Select your project’s target and click Finish.
## Basic Integration Of The AppsFlyerMigrationHelper
### Swift Example
```swift
import AppsFlyerLib
import AppsFlyerMigrationHelper
import BranchSDK
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var ConversionData: [AnyHashable: Any]? = nil
var window: UIWindow?
var deferred_deep_link_processed_flag:Bool = false
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
let isBranchSDKAvailable = NSClassFromString("Branch") != nil
Branch.enableLogging()
if #available(iOS 16.0, *) {
// Don't check pasteboard on install, instead utilize UIPasteControl
} else if #available(iOS 15.0, *) {
// Call `checkPasteboardOnInstall()` before Branch initialization
Branch.getInstance().checkPasteboardOnInstall()
}
// Check if pasteboard toast will show
if Branch.getInstance().willShowPasteboardToast(){
// You can notify the user of what just occurred here
NSLog("[Branch] willShowPasteboardToast ######")
}
Branch.getInstance().initSession(launchOptions: launchOptions) { (params, error) in
NSLog("[Branch] initSession, deep link data:")
print(params as? [String: AnyObject] ?? {})
// Access and use deep link data here (nav to page, display content, etc.)
if (params?["~referring_link"] != nil){
AFMigrationHelper.shared.setDeeplinkData(params)
}
}
Branch.getInstance().lastAttributedTouchData(withAttributionWindow:0) { (params, error) in
if let params = params {
AFMigrationHelper.shared.setAttributionData(params.lastAttributedTouchJSON, attributionWindow: params.attributionWindow)
}
}
AppsFlyerLib.shared().appleAppID = ""
AppsFlyerLib.shared().appsFlyerDevKey = ""
AppsFlyerLib.shared().isDebug = true
NotificationCenter.default.addObserver(self, selector: #selector(didBecomeActiveNotification),
name: UIApplication.didBecomeActiveNotification,
object: nil)
return true
}
@objc func didBecomeActiveNotification() {
// No Listener
AppsFlyerLib.shared().start()
}
}
```