AppsflyerSdk class


AppsflyerSdk(dynamic options)
Returns the AppsflyerSdk instance, initialized with a custom options provided by the user
AppsflyerSdk.private(MethodChannel _methodChannel, EventChannel _eventChannel, {AppsFlyerOptions afOptions, Map mapOptions})


afOptions AppsFlyerOptions
read / write
appOpenAttributionStream Stream<Map>
conversionDataStream Stream<Map>
hashCode int
The hash code for this object. [...]
read-only, inherited
mapOptions Map
read / write
onDeepLinkingStream Stream<Map>
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


enableLocationCollection(bool flag) → void
enableUninstallTracking(String senderId) → void
Please use updateServerUninstallToken instead
getAppsFlyerUID() Future<String>
Get AppsFlyer's unique device ID is created for every new install of an app.
getHostName() Future<String>
getHostPrefix() Future<String>
getSDKVersion() Future<String>
initSdk({bool registerConversionDataCallback = false, bool registerOnAppOpenAttributionCallback = false, bool registerOnDeepLinkingCallback = false}) Future
initialize the SDK, using the options initialized from the constructor|
logCrossPromotionAndOpenStore(String appId, String campaign, Map params) → void
Use the following API to attribute the click and launch the app store's app page.
logCrossPromotionImpression(String appId, String campaign, Map data) → void
To attribute an impression use the following API call. Make sure to use the promoted App ID as it appears within the AppsFlyer dashboard.
logEvent(String eventName, Map eventValues) Future<bool>
These in-app events help you to log how loyal users discover your app, and attribute them to specific campaigns/media-sources. Please take the time define the event/s you want to measure to allow you to send ROI (Return on Investment) and LTV (Lifetime Value). [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
onAppOpenAttribution(Function callback) → void
onDeepLinking(Function callback) → void
onInstallConversionData(Function callback) → void
onPurchaseValidation(Function callback) → void
setAdditionalData(Map<String, dynamic> customData) → void
Set additional data to be sent to AppsFlyer.
setAndroidIdData(String androidId) → void
setAppInviteOneLinkID(String oneLinkID, Function callback) Future<void>
Set the OneLink ID that should be used for User-Invite-API. The link that is generated for the user invite will use this OneLink ID as the base link ID
setCollectAndroidId(bool isCollect) → void
Opt-out of collection of Android ID. If the app does NOT contain Google Play Services, Android ID is collected by the SDK. However, apps with Google play services should avoid Android ID collection as this is in violation of the Google Play policy.
setCollectIMEI(bool isCollect) → void
Opt-out of collection of IMEI. If the app does NOT contain Google Play Services, device IMEI is collected by the SDK. However, apps with Google play services should avoid IMEI collection as this is in violation of the Google Play policy.
setCurrencyCode(String currencyCode) → void
Setting user local currency code for in-app purchases. The currency code should be a 3 character ISO 4217 code. (default is USD). You can set the currency code for all events by calling the following method.
setCustomerUserId(String id) → void
Setting your own customer ID enables you to cross-reference your own unique ID with AppsFlyer’s unique ID and the other devices’ IDs. This ID is available in AppsFlyer CSV reports along with Postback APIs for cross-referencing with your internal IDs.
setHost(String hostPrefix, String hostName) → void
setImeiData(String imei) → void
setIsUpdate(bool isUpdate) → void
setMinTimeBetweenSessions(int seconds) → void
setOneLinkCustomDomain(List<String> brandDomains) → void
setPushNotification(bool isEnabled) → void
setSharingFilter(List<String> filters) → void
The sharing filter blocks the sharing of S2S events via postbacks/API with integrated partners and other third-party integrations. Use the filter to fulfill regulatory requirements like GDPR and CCPA, to comply with user opt-out mechanisms, and for other business logic reasons.
setSharingFilterForAllPartners() → void
setUserEmails(List<String> emails, [EmailCryptType cryptType]) → void
Set the user emails and encrypt them.
stop(bool isStopped) → void
Once this API is invoked, our SDK no longer communicates with our servers and stops functioning. In some extreme cases you might want to shut down all SDK activity due to legal and privacy compliance. This can be achieved with the stop API.
toString() String
A string representation of this object. [...]
updateServerUninstallToken(String token) → void
Manually pass the Firebase / GCM Device Token for Uninstall measurement.
useReceiptValidationSandbox(bool isSandboxEnabled) → void
set sandbox for iOS purchase validation
validateAndLogInAppAndroidPurchase(String publicKey, String signature, String purchaseData, String price, String currency, Map<String, String> additionalParameters) Future
validateAndLogInAppIosPurchase(String productIdentifier, String price, String currency, String transactionId, Map<String, String> additionalParameters) Future
Accessing AppsFlyer purchase validation data
waitForCustomerUserId(bool wait) → void
Set to true if you want to delay sdk init until CUID is set


operator ==(Object other) bool
The equality operator. [...]