AppsFlyerLibDelegate

总览

扩展AppDelegate的协议。保存OneLink传统API和归因的回调方法。

回到SDK参考索引

协议声明

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

公共方法

onAppOpenAttribution

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

方法签名

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

onConversionDataSuccess

描述

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

方法签名

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

onAppOpenAttributionFailure

描述

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

方法签名

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

onConversionDataFail

描述

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

方法签名

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

performOnAppAttribution

描述

允许开发者手动重新触发onAppOpenAttribution,并使开发者能够在任何时候访问深度链接数据,而无需连接到应用程序启动过程。这可能是需要的,因为只有在使用深度链接打开应用程序时才会调用常规的onAppOpenAttribution回调。

方法签名

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