-
public abstract class AppsFlyerLib
-
-
Method Summary
Modifier and Type Method Description static AppsFlyerLibgetInstance()abstract voidstop(boolean shouldStop, Context context)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 logging due to legal and privacy compliance. abstract StringgetSdkVersion()Get the AppsFlyer SDK version used in app. abstract voidenableTCFDataCollection(boolean shouldCollect)Calling enableTCFDataCollection(true) will enable the SDK collectingand sending any TCF related data.Calling enableTCFDataCollection(false) will disable the SDK collection of TCF related dataand from sending it. abstract voidonPause(Context context)For Cocos2dx platform onlyCocos2dx has his own applicationDidEnterBackground event. abstract voidupdateServerUninstallToken(Context context, String token)Manually pass the Firebase Device Token for Uninstall Measurement. abstract voidsetDebugLog(boolean shouldEnable)Enables Debug logs for the AppsFlyer SDK.Should only be set to true in development / debug. abstract voidsetImeiData(String imei)By default, IMEI and Android ID are not collected by the SDK if the OS version is higher than KitKat (4.4)and the device contains Google Play Services (on SDK versions 4.8.8 and below the specific app needed GPS).Use this API to explicitly send IMEI to AppsFlyer. abstract voidsetOaidData(String oaid)By default, OAID is not collected by the SDK.Use this API to explicitly send OAID to AppsFlyer. abstract voidsetAndroidIdData(String androidId)By default, IMEI and Android ID are not collected by the SDK if the OS version is higher than KitKat (4.4)and the device contains Google Play Services (on SDK versions 4.8.8 and below the specific app needed GPS).Use this API to explicitly send Android ID to AppsFlyer. abstract voidsetCustomerUserId(String id)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. abstract voidsetPhoneNumber(String phoneNumber)Will be sent as SHA-256 abstract StringgetOutOfStore(Context context)Get the current AF_STORE value. abstract voidsetOutOfStore(String sourceName)Manually set the AF_STORE value. abstract voidsetAppInviteOneLink(String oneLinkId)Set the OneLink ID that should be used for User-Invite-loggingThe link that is generated for the user invite will use this OneLink as the base link. abstract voidsetAdditionalData(Map<String, Object> customData)Set additional data to be sent to AppsFlyer. abstract voidsendPushNotificationData(Activity activity)Allows you to measure push notifications as part of a retargeting campaign. abstract voidsendPushNotificationData(@NonNull() AFPushData pushData)Allows you to measure push notifications as part of a retargeting campaign.This method processes push notification data received from various push providers (e.g., Firebase)and collects marketing campaign details for attribution.This data is used to attribute app opens and user engagement to specific marketing campaignsand track the effectiveness of push notification campaigns.Note: Calling this method will trigger a new Launch event to be created and sent,even if a Launch event was already sent in the current session. abstract voidsetUserEmails(Array<String> emails)Set the user emails abstract voidsetUserEmails(EmailsCryptType cryptMethod, Array<String> emails)Set the user emails and encrypt them. abstract voidsetCollectAndroidID(boolean isCollect)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. abstract voidsetResolveDeepLinkURLs(Array<String> urls)Advertisers can wrap AppsFlyer OneLink within another Universal Link.This Universal Link will invoke the app but any deep linking data will not propagate to AppsFlyer. abstract voidsetOneLinkCustomDomain(Array<String> domains)In order for AppsFlyer SDK to successfully resolve hidden (decoded in shortlink ID)attribution params any domain that is configured as branded domain in AppsFlyer Dashboard should be provided in this API abstract AppsFlyerLibinit(@NonNull() String key, AppsFlyerConversionListener conversionDataListener, @NonNull() Context context)Use this method to initialize AppsFlyer SDK.This API should be called inside your Application class's onCreate method. abstract voidcollectDataFromLauncherActivity(Activity activity)abstract voidstart()abstract voidstart(AppsFlyerRequestListener listener)abstract voidsetAppId(String id)abstract voidsetIsUpdate(boolean isUpdate)Manually set that the application was updated. abstract voidsetCurrencyCode(String currencyCode)Setting user local currency code for in-app purchases.The currency code should be a 3 character ISO 4217 code. abstract voidlogLocation(Context context, double latitude, double longitude)Manually log the location of the user abstract voidlogSession(Context ctx)If your app is a utility app running in the background you can use this API in your activity's onCreate() abstract voidlogEvent(Context context, String eventName, Map<String, Object> eventValues)Log an In-App Event.In-App Events provide insight on what is happening in your app. abstract voidlogAdRevenue(@NonNull() AFAdRevenueData adRevenueData, @Nullable() Map<String, Object> additionalParameters)Logs ad revenue data along with additional parameters if provided. abstract voidlogEvent(@NonNull() Context context, String eventName, Map<String, Object> eventValues, AppsFlyerRequestListener listener)Same as logEvent with AppsFlyerRequestListener. abstract voidanonymizeUser(boolean shouldAnonymize)Anonymize user Data.Use this API during the SDK Initialization to explicitly anonymize a user's installs, events and sessions. abstract voidenableFacebookDeferredApplinks(boolean isEnabled)Enable the collection of Facebook Deferred AppLinksRequires Facebook SDK and Facebook app on target/client device.This API must be invoked prior to initializing the AppsFlyer SDK in order to function properly. abstract voidregisterConversionListener(@NonNull() AppsFlyerConversionListener conversionDataListener)Register a Conversion Data Listener.Allows the developer to access the user attribution data in real-time for every new install, directly from the SDK level.By doing this you can serve users with personalized content or send them to specific activities within the app,which can greatly enhance their engagement with your app. abstract voidunregisterConversionListener()Unregister a previously registered AppsFlyerConversionListener. abstract voidsetPreinstallAttribution(String mediaSource, String campaign, String siteId)Specify the manufacturer or media source name to which the preinstall is attributed. abstract booleanisPreInstalledApp(Context context)Boolean indicator for preinstall by Manufacturer. abstract StringgetAttributionId(Context context)Get the Facebook attribution ID, if one exists. abstract StringgetAppsFlyerUID(@NonNull() Context context)Get AppsFlyer's unique device ID is created for every new install of an app. abstract booleanisStopped()Was the stop API set to true. abstract voidsetMinTimeBetweenSessions(int seconds)Set a custom value for the minimum required time between sessions.By default, at least 5 seconds must lapse between 2 app launches to count as separate 2 sessions. abstract voidsetLogLevel(AFLogger.LogLevel logLevel)Sets the SDK's Log Level. abstract voidsetHost(@Nullable() String hostPrefixName, @NonNull() String hostName)Set a custom host. abstract StringgetHostName()Get the host name.Default value is "appsflyer. abstract StringgetHostPrefix()Get the custom set host prefix. abstract voidappendParametersToDeepLinkingURL(String contains, Map<String, String> parameters)abstract voidsetDeepLinkTimeout(long timeout)Sets the timeout duration for deep link resolution in milliseconds.This timeout determines how long the SDK will wait for a deep link to be resolvedbefore considering the operation failed.The default timeout value is 3000ms. abstract voidsubscribeForDeepLink(DeepLinkListener deepLinkListener)abstract voidperformDeepLinking(@NonNull() String url, boolean shouldTriggerSession)Manually trigger deep link resolution for a given URL.This method allows you to programmatically process deep links and handle the deep linking flow. abstract voidaddPushNotificationDeepLinkPath(Array<String> deepLinkPath)Resolve deep links from the push notification. abstract voidsetPartnerData(@NonNull() String partnerId, Map<String, Object> data)Allows sending custom data for partner integration purposes. abstract voidsetDisableAdvertisingIdentifiers(boolean disable)Disable collection of Google, Amazon and Open advertising ids (GAID, AAID, OAID).By default collection is enabled. abstract voidsetDisableNetworkData(boolean disable)Use this API to prevent the SDK from collecting the network operator name (carrier) and simoperator name from the deviceBy default collection is enabled. abstract voidsetSharingFilterForPartners(Array<String> partners)Block events from being shared with ad networks and other 3rd party integrations.String "all" will block events from being shared with any partner. abstract voidsendPurchaseData(Context context, Map<String, Object> requestData, PurchaseHandler.PurchaseValidationCallback callback)Send ars purchase data for validation and reporting. abstract voidsendInAppPurchaseData(Context context, Map<String, Object> requestData, PurchaseHandler.PurchaseValidationCallback callback)Send in app purchase data for validation and reporting. abstract voidsetPluginInfo(@NonNull() PluginInfo pluginInfo)Internal API. abstract voidsetConsentData(@NonNull() AppsFlyerConsent consent)Sets or updates the user consent data related to GDPR and DMA regulations for advertising and data usagepurposes within the application. abstract voidvalidateAndLogInAppPurchase(@NonNull() AFPurchaseDetails afPurchaseDetails, @Nullable() Map<String, String> additionalParameters, @Nullable() AppsFlyerInAppPurchaseValidationCallback callback)abstract voidsetInstallId(@NonNull() String installId)Sets the unique install ID for the app installation. abstract voiddisableAppSetId()If this method is called - AppsFlyer SDK will no longer collect App Set Id,even if such dependency is added to the app. abstract voidregisterSessionReadyListener(@NonNull() SessionReadyListener listener)Registers a callback to be notified when the SDK is ready to trigger a new session. abstract voidunregisterSessionReadyListener()Unregisters a previously registered SessionReadyListener. abstract booleanisSessionReady()Returns whether all session readiness conditions are currently satisfied. -
-
Method Detail
-
getInstance
static AppsFlyerLib getInstance()
-
stop
abstract void stop(boolean shouldStop, Context context)
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 logging due to legal and privacy compliance.This can be achieved with the isStopped API
- Parameters:
shouldStop- should logging be stopped.context- Application / Activity context.
-
getSdkVersion
abstract String getSdkVersion()
Get the AppsFlyer SDK version used in app.
-
enableTCFDataCollection
abstract void enableTCFDataCollection(boolean shouldCollect)
Calling enableTCFDataCollection(true) will enable the SDK collectingand sending any TCF related data.Calling enableTCFDataCollection(false) will disable the SDK collection of TCF related dataand from sending it.
- Parameters:
shouldCollect- should start TCF Data collection.
-
onPause
abstract void onPause(Context context)
For Cocos2dx platform onlyCocos2dx has his own applicationDidEnterBackground event.Therefore 'onPause' will be called from C++ by JNI
-
updateServerUninstallToken
abstract void updateServerUninstallToken(Context context, String token)
Manually pass the Firebase Device Token for Uninstall Measurement.
- Parameters:
context- Application / Activity context.token- Firebase Device Token.
-
setDebugLog
abstract void setDebugLog(boolean shouldEnable)
Enables Debug logs for the AppsFlyer SDK.Should only be set to true in development / debug.
- Parameters:
shouldEnable- boolean.
-
setImeiData
abstract void setImeiData(String imei)
By default, IMEI and Android ID are not collected by the SDK if the OS version is higher than KitKat (4.4)and the device contains Google Play Services (on SDK versions 4.8.8 and below the specific app needed GPS).Use this API to explicitly send IMEI to AppsFlyer.
- Parameters:
imei- device's IMEI.
-
setOaidData
abstract void setOaidData(String oaid)
By default, OAID is not collected by the SDK.Use this API to explicitly send OAID to AppsFlyer.
- Parameters:
oaid- device's OAID.
-
setAndroidIdData
abstract void setAndroidIdData(String androidId)
By default, IMEI and Android ID are not collected by the SDK if the OS version is higher than KitKat (4.4)and the device contains Google Play Services (on SDK versions 4.8.8 and below the specific app needed GPS).Use this API to explicitly send Android ID to AppsFlyer.
- Parameters:
androidId- device's Android ID.
-
setCustomerUserId
abstract void setCustomerUserId(String id)
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.
- Parameters:
id- Customer ID for client.
-
setPhoneNumber
abstract void setPhoneNumber(String phoneNumber)
Will be sent as SHA-256
-
getOutOfStore
abstract String getOutOfStore(Context context)
Get the current AF_STORE value.
- Parameters:
context- Application / Activity context.
-
setOutOfStore
abstract void setOutOfStore(String sourceName)
Manually set the AF_STORE value.
- Parameters:
sourceName- value to be set.
-
setAppInviteOneLink
abstract void setAppInviteOneLink(String oneLinkId)
Set the OneLink ID that should be used for User-Invite-loggingThe link that is generated for the user invite will use this OneLink as the base link.
- Parameters:
oneLinkId- OneLink ID obtained from the AppsFlyer Dashboard.
-
setAdditionalData
abstract void setAdditionalData(Map<String, Object> customData)
Set additional data to be sent to AppsFlyer.
- Parameters:
customData- additional data HashMap.
-
sendPushNotificationData
abstract void sendPushNotificationData(Activity activity)
Allows you to measure push notifications as part of a retargeting campaign.To enable this feature, call the next method inside the onResume method of every Activity which will be launched upon clicking the notification.
- Parameters:
activity- The Activity which will be launched upon clicking the notification.
-
sendPushNotificationData
abstract void sendPushNotificationData(@NonNull() AFPushData pushData)
Allows you to measure push notifications as part of a retargeting campaign.This method processes push notification data received from various push providers (e.g., Firebase)and collects marketing campaign details for attribution.This data is used to attribute app opens and user engagement to specific marketing campaignsand track the effectiveness of push notification campaigns.Note: Calling this method will trigger a new Launch event to be created and sent,even if a Launch event was already sent in the current session. This ensures properattribution of the push notification campaign.
- Parameters:
pushData- The AFPushData object containing push notification details.This includes campaign information, deep linking data, and othermarketing-related parameters received from the push notification.
-
setUserEmails
abstract void setUserEmails(Array<String> emails)
Set the user emails
- Parameters:
emails- User emails.
-
setUserEmails
abstract void setUserEmails(EmailsCryptType cryptMethod, Array<String> emails)
Set the user emails and encrypt them.
- Parameters:
cryptMethod- Encryption method:EmailsCryptType.NONE,EmailsCryptType.emails- User emails.
-
setCollectAndroidID
abstract void setCollectAndroidID(boolean isCollect)
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.
- Parameters:
isCollect- boolean, false to opt-out.
-
setResolveDeepLinkURLs
abstract void setResolveDeepLinkURLs(Array<String> urls)
Advertisers can wrap AppsFlyer OneLink within another Universal Link.This Universal Link will invoke the app but any deep linking data will not propagate to AppsFlyer.
setResolveDeepLinkURLsAPI allows to Appsflyer SDK to resolveprovided urls, to be able to deep link from a OneLinkwrapped within another Universal Link and also log this retargetingconversion.For example:
"example.com""example.com/param1""example.com/param1/param2"
Note, if
"example.com"is provided, the App link"my.example.com"will not match because of prefix"my."Be sure to provide explicit url names- Parameters:
urls- - Array of urls
-
setOneLinkCustomDomain
abstract void setOneLinkCustomDomain(Array<String> domains)
In order for AppsFlyer SDK to successfully resolve hidden (decoded in shortlink ID)attribution params any domain that is configured as branded domain in AppsFlyer Dashboard should be provided in this API
- Parameters:
domains- Array of domains that should be treated by SDK as branded (SDK will try toresolve them as Onelinks)
-
init
abstract AppsFlyerLib init(@NonNull() String key, AppsFlyerConversionListener conversionDataListener, @NonNull() Context context)
Use this method to initialize AppsFlyer SDK.This API should be called inside your Application class's onCreate method.
- Parameters:
key- AppsFlyer's Dev-Key, which is accessible from your AppsFlyeraccount, under 'App Settings' in the dashboard.conversionDataListener- (Optional) implement the ConversionDataListener toaccess AppsFlyer's conversion data.context- to handle new install referrer
-
collectDataFromLauncherActivity
abstract void collectDataFromLauncherActivity(Activity activity)
-
start
abstract void start()
-
start
abstract void start(AppsFlyerRequestListener listener)
-
setIsUpdate
abstract void setIsUpdate(boolean isUpdate)
Manually set that the application was updated.
- Parameters:
isUpdate- boolean value
-
setCurrencyCode
abstract void setCurrencyCode(String currencyCode)
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
- Parameters:
currencyCode- 3 character ISO 4217 code
-
logLocation
abstract void logLocation(Context context, double latitude, double longitude)
Manually log the location of the user
- Parameters:
context- Application / Activity contextlatitude- latitude as doublelongitude- longitude as double
-
logSession
abstract void logSession(Context ctx)
If your app is a utility app running in the background you can use this API in your activity's onCreate()
- Parameters:
ctx- Application / Activity context
-
logEvent
abstract void logEvent(Context context, String eventName, Map<String, Object> eventValues)
Log an In-App Event.In-App Events provide insight on what is happening in your app.
- Parameters:
context- Application / Activity contexteventName- Event Name as StringeventValues- Event Values as Map
-
logAdRevenue
abstract void logAdRevenue(@NonNull() AFAdRevenueData adRevenueData, @Nullable() Map<String, Object> additionalParameters)
Logs ad revenue data along with additional parameters if provided.
- Parameters:
adRevenueData- The AFAdRevenueData object containing ad revenue information.additionalParameters- An optional map of additional parameters to be logged with ad revenue data.
-
logEvent
abstract void logEvent(@NonNull() Context context, String eventName, Map<String, Object> eventValues, AppsFlyerRequestListener listener)
Same as logEvent with AppsFlyerRequestListener. HTTP_OK fromserver will invoke the onSuccess method. onError will returnthe error in case one occurs
-
anonymizeUser
abstract void anonymizeUser(boolean shouldAnonymize)
Anonymize user Data.Use this API during the SDK Initialization to explicitly anonymize a user's installs, events and sessions.Default is false
- Parameters:
shouldAnonymize- boolean
-
enableFacebookDeferredApplinks
abstract void enableFacebookDeferredApplinks(boolean isEnabled)
Enable the collection of Facebook Deferred AppLinksRequires Facebook SDK and Facebook app on target/client device.This API must be invoked prior to initializing the AppsFlyer SDK in order to function properly.
- Parameters:
isEnabled- should Facebook's deferred app links be processed by the AppsFlyer SDK.
-
registerConversionListener
abstract void registerConversionListener(@NonNull() AppsFlyerConversionListener conversionDataListener)
Register a Conversion Data Listener.Allows the developer to access the user attribution data in real-time for every new install, directly from the SDK level.By doing this you can serve users with personalized content or send them to specific activities within the app,which can greatly enhance their engagement with your app.
- Parameters:
conversionDataListener- AppsFlyerConversionListener interface withonConversionDataSuccesscallback methods.
-
unregisterConversionListener
abstract void unregisterConversionListener()
Unregister a previously registered AppsFlyerConversionListener.
-
setPreinstallAttribution
abstract void setPreinstallAttribution(String mediaSource, String campaign, String siteId)
Specify the manufacturer or media source name to which the preinstall is attributed.
- Parameters:
mediaSource- Manufacturer or media source name for preinstall attribution.campaign- Campaign name for preinstall attribution.siteId- Site ID for preinstall attribution.
-
isPreInstalledApp
abstract boolean isPreInstalledApp(Context context)
Boolean indicator for preinstall by Manufacturer.
- Parameters:
context- Application / Activity context.
-
getAttributionId
abstract String getAttributionId(Context context)
Get the Facebook attribution ID, if one exists.
-
getAppsFlyerUID
@Nullable() abstract String getAppsFlyerUID(@NonNull() Context context)
Get AppsFlyer's unique device ID is created for every new install of an app.
- Parameters:
context- Application / Activity context.
-
setMinTimeBetweenSessions
abstract void setMinTimeBetweenSessions(int seconds)
Set a custom value for the minimum required time between sessions.By default, at least 5 seconds must lapse between 2 app launches to count as separate 2 sessions.
- Parameters:
seconds- minimum time between 2 separate sessions in seconds.
-
setLogLevel
abstract void setLogLevel(AFLogger.LogLevel logLevel)
Sets the SDK's Log Level.
- Parameters:
logLevel- logLevel as String:AFLogger.LogLevel.NONE,AFLogger.LogLevel.ERROR,AFLogger.LogLevel.WARNING,AFLogger.LogLevel.INFO,AFLogger.LogLevel.DEBUG,AFLogger.LogLevel.VERBOSE.
-
setHost
abstract void setHost(@Nullable() String hostPrefixName, @NonNull() String hostName)
Set a custom host.
- Parameters:
hostPrefixName- Host prefix.hostName- Host name.
-
getHostName
abstract String getHostName()
Get the host name.Default value is "appsflyer.com"
-
getHostPrefix
abstract String getHostPrefix()
Get the custom set host prefix.
-
appendParametersToDeepLinkingURL
abstract void appendParametersToDeepLinkingURL(String contains, Map<String, String> parameters)
-
setDeepLinkTimeout
abstract void setDeepLinkTimeout(long timeout)
Sets the timeout duration for deep link resolution in milliseconds.This timeout determines how long the SDK will wait for a deep link to be resolvedbefore considering the operation failed.The default timeout value is 3000ms.
- Parameters:
timeout- The timeout duration in milliseconds.
-
subscribeForDeepLink
abstract void subscribeForDeepLink(DeepLinkListener deepLinkListener)
-
performDeepLinking
abstract void performDeepLinking(@NonNull() String url, boolean shouldTriggerSession)
Manually trigger deep link resolution for a given URL.This method allows you to programmatically process deep links and handle the deep linking flow.When the deep link is resolved:- If DeepLinkListener is registered, it will be triggered via onDeepLinking For retargeting flows, it is recommended to set shouldTriggerSession to true to properly track the re-engagement.
- Parameters:
url- The deep link URL to be processed.shouldTriggerSession- If true, the deep link will trigger a new session.
-
addPushNotificationDeepLinkPath
abstract void addPushNotificationDeepLinkPath(Array<String> deepLinkPath)
Resolve deep links from the push notification.
Specify path to deeplink url in the data part of the push notification payloadin order to get them resolved to 1 of the the callbacks when app is opened by a clickon a notification:
onDeepLinking- Parameters:
deepLinkPath- List of path elements in correct order
-
setPartnerData
abstract void setPartnerData(@NonNull() String partnerId, Map<String, Object> data)
Allows sending custom data for partner integration purposes.
- Parameters:
partnerId- ID of the partner (usually has "_int" suffix)data- customer data, depends on the integration nature with specific partner
-
setDisableAdvertisingIdentifiers
abstract void setDisableAdvertisingIdentifiers(boolean disable)
Disable collection of Google, Amazon and Open advertising ids (GAID, AAID, OAID).By default collection is enabled.
-
setDisableNetworkData
abstract void setDisableNetworkData(boolean disable)
Use this API to prevent the SDK from collecting the network operator name (carrier) and simoperator name from the deviceBy default collection is enabled.
-
setSharingFilterForPartners
abstract void setSharingFilterForPartners(Array<String> partners)
Block events from being shared with ad networks and other 3rd party integrations.String "all" will block events from being shared with any partner.
- Parameters:
partners- must only include letters/digits and underscore, maximum length: 45
-
sendPurchaseData
abstract void sendPurchaseData(Context context, Map<String, Object> requestData, PurchaseHandler.PurchaseValidationCallback callback)
Send ars purchase data for validation and reporting. Not intended for public usage, to be usedonly from AppsFlyer Purchase Connector module
- Parameters:
context- Application contextrequestData- ars purchase data for validationcallback- to return the validation result
-
sendInAppPurchaseData
abstract void sendInAppPurchaseData(Context context, Map<String, Object> requestData, PurchaseHandler.PurchaseValidationCallback callback)
Send in app purchase data for validation and reporting. Not intended for public usage, to be usedonly from AppsFlyer Purchase Connector module
- Parameters:
context- Application contextrequestData- in app purchase data for validationcallback- to return the validation result
-
setPluginInfo
abstract void setPluginInfo(@NonNull() PluginInfo pluginInfo)
Internal API. Please don't use.Throws: NullPointerException – if pluginInfo is null.
-
setConsentData
abstract void setConsentData(@NonNull() AppsFlyerConsent consent)
Sets or updates the user consent data related to GDPR and DMA regulations for advertising and data usagepurposes within the application. This method must be invoked with the user's current consent status eachtime the app starts or whenever there is a change in the user's consent preferences.When creating an instance of AppsFlyerConsent, use the appropriate static method based on the user'sGDPR compliance status: forGDPRUser if the user is a subject of GDPR, or forNonGDPRUser if not.Note that this method does not persist the consent data across app sessions; it only applies for theduration of the current app session. If you wish to stop providing the consent data, you shouldcease calling this method.
- Parameters:
consent- an instance of AppsFlyerConsent that encapsulates the user's consent information.
-
validateAndLogInAppPurchase
abstract void validateAndLogInAppPurchase(@NonNull() AFPurchaseDetails afPurchaseDetails, @Nullable() Map<String, String> additionalParameters, @Nullable() AppsFlyerInAppPurchaseValidationCallback callback)
- Parameters:
afPurchaseDetails- Datails of the PurchaseadditionalParameters- Freehand parameters to be logged with the purchase.callback- Results of purchase validation callback
-
setInstallId
abstract void setInstallId(@NonNull() String installId)
Sets the unique install ID for the app installation.
- Parameters:
installId- The unique install ID for the app installation.
-
disableAppSetId
abstract void disableAppSetId()
If this method is called - AppsFlyer SDK will no longer collect App Set Id,even if such dependency is added to the app.
-
registerSessionReadyListener
abstract void registerSessionReadyListener(@NonNull() SessionReadyListener listener)
Registers a callback to be notified when the SDK is ready to trigger a new session.
Developers should call start within this callback to ensure proper session initializationwith all required data (e.g., deeplink parameters).
Example usage:
AppsFlyerLib.getInstance().registerSessionReadyListener(() -> { // SDK is ready - you can now call start() AppsFlyerLib.getInstance().start(); });- Parameters:
listener- The callback listener to be invoked when the session is ready.
-
unregisterSessionReadyListener
abstract void unregisterSessionReadyListener()
Unregisters a previously registered SessionReadyListener.
-
isSessionReady
abstract boolean isSessionReady()
Returns whether all session readiness conditions are currently satisfied.
-
-
-
-