AppsFlyerSDK / AppsFlyerFramework

AppsFlyer Apple SDK
https://support.appsflyer.com/hc/en-us/articles/207032066-AppsFlyer-SDK-Integration-iOS
Other
173 stars 92 forks source link

Delegate is `nil` or does not respond to -[AppsFlyerLibDelegate onConversionDataSuccess:] #301

Closed DanilAtyukov-dev closed 3 months ago

DanilAtyukov-dev commented 3 months ago

Report

SDK Version

6.15.1 added with SPM

What did you do?

class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

        AppsFlyerLib.shared().appsFlyerDevKey = "****"
        AppsFlyerLib.shared().appleAppID = "****"
         AppsFlyerLib.shared().isDebug = true

        NotificationCenter.default.addObserver(self, selector: NSSelectorFromString("sendLaunch"), name: UIApplication.didBecomeActiveNotification, object: nil)
        return true
    }
    @objc func sendLaunch() {
        AppsFlyerLib.shared().start()
    }

}

var ConversionData: [AnyHashable: Any]? = nil extension AppDelegate: AppsFlyerLibDelegate {

func onConversionDataSuccess(_ data: [AnyHashable: Any]) {
    ConversionData = data
    print("af success")
}

func onConversionDataFail(_ error: any Error) {
    print("af fail")
}

}

What did you expect to happen?

calling the onConversionDataSuccess function or onConversionDataFail

What happened instead?

Снимок экрана 2024-08-20 в 21 19 18

amit-kremer93 commented 3 months ago

you must set the delegate for the conversion data: AppsFlyerLib.shared().delegate = self