AppsflyerSdk class

Constructors

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

Properties

afOptions AppsFlyerOptions?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
mapOptions Map?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addPushNotificationDeepLinkPath(List<String> deeplinkPath) → void
Adds array of keys, which are used to compose key path to resolve deeplink from push notification payload.
anonymizeUser(bool shouldAnonymize) → void
Opt-out logging for specific user
disableSKAdNetwork(bool isEnabled) → void
Disables SKAdNetwork (iOS 14 attribution framework).
Enables or disables Facebook deferred deep links.
enableTCFDataCollection(bool shouldCollect) → void
Setting whether the SDK should collect tcf data automatically from SharedPreferences/UserDefaults
enableUninstallTracking(String senderId) → void
Please use updateServerUninstallToken instead (deprecated)
Generates an invite link using the specified parameters, aka User Invite feature
getAppsFlyerUID() Future<String?>
Get AppsFlyer's unique device ID is created for every new install of an app.
getHostName() Future<String?>
Retrieves the host name.
getHostPrefix() Future<String?>
Retrieves the host prefix.
getOutOfStore() Future<String?>
Gets out of store app install source.
getSDKVersion() Future<String?>
Retrieves the current SDK version.
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 nonexistent method or property is accessed.
inherited
onAppOpenAttribution(Function callback) → void
Listens for attribution data following app open.
onDeepLinking(dynamic callback(DeepLinkResult)) → void
Handles deep link result.
onInstallConversionData(Function callback) → void
Listens for conversion data following app install.
onPurchaseValidation(Function callback) → void
Validates purchase.
performOnDeepLinking() → void
Opt-out logging for specific user
sendPushNotificationData(Map? userInfo) → void
Sends push notification data.
setAdditionalData(Map<String, dynamic>? customData) → void
Set additional data to be sent to AppsFlyer.
setAndroidIdData(String androidId) → void
Sets Android ID.
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.
setConsentData(AppsFlyerConsent consentData) → void
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.
setCurrentDeviceLanguage(String language) → void
Sets the current device language.
setCustomerIdAndLogSession(String id) → void
Set customer user ID and unlock the wait for customer user id. Use with waitForCustomerUserId
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.
setDisableAdvertisingIdentifiers(bool isEnabled) → void
Disables tracking of advertising identifiers.
setDisableNetworkData(bool disable) → void
Disables transfer of user-specific data over the network.
setHost(String hostPrefix, String hostName) → void
Sets the host name and the host prefix. This is only relevant if you need to switch between HTTPS environments.
setImeiData(String imei) → void
Sets the IMEI for the device.
setIsUpdate(bool isUpdate) → void
setMinTimeBetweenSessions(int seconds) → void
Set the minimum time between sessions. Any app launches that happen within this minimum threshold will be attributed to the current session. Launches that occur after this threshold has been crossed will be counted as a separate session.
setOneLinkCustomDomain(List<String> brandDomains) → void
Sets custom domain for OneLink aka Branded Domains
setOutOfStore(String sourceName) → void
Sets out of store app install source.
setPartnerData(String partnerId, Map<String, Object> partnerData) → void
Sets the partner-specific data.
setPushNotification(bool isEnabled) → void
Is push notification enabled or not (deprecated)
setResolveDeepLinkURLs(List<String> urls) → void
Sets URLs to deep link into the app when the app is first installed.
setSharingFilter(List<String> partners) → void
Sets sharing filter for specific partners (deprecated).
setSharingFilterForAllPartners() → void
Sets sharing filter for all partners (deprecated).
setSharingFilterForPartners(List<String> partners) → 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.
setUserEmails(List<String> emails, [EmailCryptType? cryptType]) → void
Set the user emails and encrypt them.
startSDK({RequestSuccessListener? onSuccess, RequestErrorListener? onError}) → void
Initializes the SDK and sets up a method call handler to listen for native callbacks. Guards against multiple initializations with _isSdkStarted
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.
inherited
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
Validate and log the In-App Purchase for Android on AppsFlyer's dashboard.
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

Operators

operator ==(Object other) bool
The equality operator.
inherited