AppsFlyerLibDelegate

Overview

Protocol extending AppDelegate. Holds the callback method for OneLink legacy APIs and attribution.

Go back to the SDK reference index.

Protocol declaration

extension AppDelegate: AppsFlyerLibDelegate {
     
    func onConversionDataSuccess(_ data: [AnyHashable: Any]) {
    ...
    }
    
    func onConversionDataFail(_ error: Error) {
    ...
    }
    
    func onAppOpenAttribution(_ attributionData: [AnyHashable: Any]) {
    ...
    }
    
    func onAppOpenAttributionFailure(_ error: Error) {
    ...
    }
}

Public methods

onAppOpenAttribution

Description
Get data for users when the app opens via direct deep linking (not via deferred deep linking).
Learn more about onAppOpenAttribution() for iOS.

Method signature

func onAppOpenAttribution(_ attributionData: [AnyHashable: Any]) {
        //Handle Deep Link Data
}
(void) onAppOpenAttribution:(NSDictionary*) attributionData {
        //Handle Deep Link
    }

onConversionDataSuccess

Description

Get conversion data after an install. Useful for deferred deep linking.
Learn more about onConversionDataSuccess() for iOS.

Method signature

func onConversionDataSuccess(_ installData: [AnyHashable: Any]) {
      //Handle Conversion Data (Deferred Deep Link)
}
-(void)onConversionDataSuccess:(NSDictionary*) installData {
      //Handle Conversion Data (Deferred Deep Link)
}

onAppOpenAttributionFailure

Description

Handle errors when failing to get conversion data from installs.
Learn more about onAppOpenAttributionFailure() for iOS.

Method signature

func onAppOpenAttributionFailure(_ error: Error?)
- (void)onAppOpenAttributionFailure:(NSError *)error;

onConversionDataFail

Description

Handle errors when failing to get conversion data from installs.
Learn more about onConversionDataFail() for iOS.

Method signature

func onConversionDataFail(_ error: Error?) {
        //    print("\(error)")
        // handle conversion data failure
}
-(void)onConversionDataFail:(NSError *) error {
      NSLog(@"%@",error);
      // handle conversion data failure
}

performOnAppAttribution

Description

Allows developers to manually re-trigger onAppOpenAttribution and enables developers to access deep link data at any time without connection to the app launch process. This might be needed because the regular onAppOpenAttribution callback is only called if the app was opened with the deep link.

Method signature

AppsFlyerLib.shared().performOnAppAttribution(with: url)
[[AppsFlyerLib shared] performOnAppAttributionWithURL:(NSURL * _Nullable)url];

Did this page help you?