public class AppsFlyerLibCore extends AppsFlyerLib
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
AF_PRE_INSTALL_PATH |
static java.lang.String |
IS_STOP_TRACKING_USED |
protected android.net.Uri |
latestDeepLink |
static java.lang.String |
LOG_TAG |
static java.lang.String |
PRE_INSTALL_SYSTEM_DEFAULT |
static java.lang.String |
PRE_INSTALL_SYSTEM_DEFAULT_ETC |
static java.lang.String |
PRE_INSTALL_SYSTEM_RO_PROP |
| Modifier and Type | Method and Description |
|---|---|
void |
enableFacebookDeferredApplinks(boolean isEnabled)
Enable the collection of Facebook Deferred AppLinks
Requires Facebook SDK and Facebook app on target/client device.
|
AppsFlyerLib |
enableLocationCollection(boolean flag)
Enable the AppsFlyer SDK to collect the last known location,
Requires
Manifest.permission#ACCESS_COARSE_LOCATION
and Manifest.permission#ACCESS_FINE_LOCATION Manifest permissions. |
java.lang.String |
getAppsFlyerUID(android.content.Context context)
Get AppsFlyer's unique device ID is created for every new install of an app.
|
java.lang.String |
getAttributionId(android.content.Context context)
Get the Facebook attribution ID, if one exists.
|
protected void |
getConversionData(android.content.Context context,
ConversionDataListener conversionDataListener) |
java.lang.String |
getHostName()
Get the host name used for tracking.
|
java.lang.String |
getHostPrefix()
Get the custom set tracking host prefix.
|
static AppsFlyerLibCore |
getInstance() |
java.lang.String |
getOutOfStore(android.content.Context context)
Get the current AF_STORE value.
|
java.lang.String |
getSdkVersion()
Get the AppsFlyer SDK version used in app.
|
protected void |
handleDeepLinkCallback(android.content.Context context,
java.util.Map<java.lang.String,java.lang.Object> params,
android.net.Uri uri) |
AppsFlyerLib |
init(java.lang.String key,
AppsFlyerConversionListener conversionDataListener)
Use this method to initialize AppsFlyer SDK.
|
AppsFlyerLib |
init(java.lang.String key,
AppsFlyerConversionListener conversionDataListener,
android.content.Context context)
Same as
AppsFlyerLib.init(String, AppsFlyerConversionListener)
with additional argument Context to handle new install referrer |
boolean |
isPreInstalledApp(android.content.Context context)
Boolean indicator for preinstall by Manufacturer.
|
boolean |
isTrackingStopped()
Was the
AppsFlyerLib.stopTracking(boolean, Context) API set to true. |
void |
onHandleReferrer(java.util.Map<java.lang.String,java.lang.String> referrer)
Internal API.
|
void |
onPause(android.content.Context context)
For Cocos2dx platform only
Cocos2dx has his own applicationDidEnterBackground event.
|
void |
registerConversionListener(android.content.Context context,
AppsFlyerConversionListener conversionDataListener)
Register a Conversion Data Listener.
|
void |
registerValidatorListener(android.content.Context context,
AppsFlyerInAppPurchaseValidatorListener validationListener)
|
void |
reportTrackSession(android.content.Context ctx)
If your app is a utility app running in the background you can use this API in your activity’s onCreate()
|
void |
sendDeepLinkData(android.app.Activity activity)
Send tracking data from deep-linkable Activity.
|
void |
sendPushNotificationData(android.app.Activity activity)
Allows you to measure push notifications as part of a retargeting campaign.
|
void |
setAdditionalData(java.util.HashMap<java.lang.String,java.lang.Object> customData)
Set additional data to be sent to AppsFlyer.
|
void |
setAndroidIdData(java.lang.String aAndroidId)
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).
|
void |
setAppId(java.lang.String id) |
void |
setAppInviteOneLink(java.lang.String oneLinkId)
Set the OneLink ID that should be used for User-Invite-tracking
The link that is generated for the user invite will use this OneLink as the base link.
|
void |
setCollectAndroidID(boolean isCollect)
Opt-out of collection of Android ID.
|
void |
setCollectIMEI(boolean isCollect)
Opt-out of collection of IMEI.
|
void |
setCollectOaid(boolean isCollect)
Opt-in of collection of OAID.
|
void |
setConsumeAFDeepLinks(boolean doConsume)
Restrict the tracking of reengagement via deep-link to once per each unique deep-link.
|
void |
setCurrencyCode(java.lang.String currencyCode)
Setting user local currency code for in-app purchases.
|
void |
setCustomerIdAndTrack(java.lang.String id,
android.content.Context context)
Use this API to provide the SDK with the relevant customer user id and trigger the SDK to begin its normal tracking.
|
void |
setCustomerUserId(java.lang.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.
|
void |
setDebugLog(boolean shouldEnable)
Enables Debug logs for the AppsFlyer SDK.
|
protected void |
setDeepLinkData(android.content.Intent intent) |
void |
setDeviceTrackingDisabled(boolean isDisabled)
Anonymize user Data.
|
void |
setExtension(java.lang.String extension)
SDK plugins and extensions will set this field
|
void |
setHost(java.lang.String hostPrefixName,
java.lang.String hostName)
Set a custom host for tracking.
|
void |
setHostName(java.lang.String hostname)
Deprecated.
|
void |
setImeiData(java.lang.String aImei)
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).
|
void |
setIsUpdate(boolean isUpdate)
Manually set that the application was updated.
|
void |
setLogLevel(AFLogger.LogLevel logLevel)
Sets the SDK's Log Level.
|
void |
setMinTimeBetweenSessions(int seconds)
Set a custom value for the minimum required time between sessions.
|
void |
setOaidData(java.lang.String oaid)
By default, OAID is not collected by the SDK.
|
void |
setOneLinkCustomDomain(java.lang.String... domains) |
void |
setOutOfStore(java.lang.String sourceName)
Manually set the AF_STORE value.
|
void |
setPhoneNumber(java.lang.String phoneNumber)
Will be sent as SHA-256
|
void |
setPluginDeepLinkData(android.content.Intent intent)
This API responsible to handle Deeplink for AF plugins such RN and Cordova
|
void |
setPreinstallAttribution(java.lang.String mediaSource,
java.lang.String campaign,
java.lang.String siteId)
Specify the manufacturer or media source name to which the preinstall is attributed.
|
void |
setResolveDeepLinkURLs(java.lang.String... urls)
Advertisers can wrap AppsFlyer OneLink within another Universal Link.
|
void |
setUserEmails(AppsFlyerProperties.EmailsCryptType cryptMethod,
java.lang.String... emails)
Set the user emails and encrypt them.
|
void |
setUserEmails(java.lang.String... emails)
Set the user emails
|
void |
startTracking(android.app.Application application)
Use this method to start tracking the application,
only if you call 'init' inside you Application class's onCreate method.
|
void |
startTracking(android.app.Application application,
java.lang.String key)
Use this method to start tracking the application.
|
void |
startTracking(android.app.Application application,
java.lang.String key,
AppsFlyerTrackingRequestListener onTrackingRequestListener)
Use this method to start tracking the application.
|
void |
stopTracking(boolean isTrackingStopped,
android.content.Context context)
Once this API is invoked, our SDK no longer communicates with our servers and stops functioning.
|
void |
trackAppLaunch(android.content.Context ctx,
java.lang.String devKey)
Send an immediate launch event (regardless of lifecycle)
|
void |
trackEvent(android.content.Context context,
java.lang.String eventName,
java.util.Map<java.lang.String,java.lang.Object> eventValues)
Track an In-App Event.
|
void |
trackEvent(android.content.Context context,
java.lang.String eventName,
java.util.Map<java.lang.String,java.lang.Object> eventValues,
AppsFlyerTrackingRequestListener listener)
|
void |
trackLocation(android.content.Context context,
double latitude,
double longitude)
Manually track the location of the user
|
void |
unregisterConversionListener()
Unregister a previously registered AppsFlyerConversionListener.
|
void |
updateServerUninstallToken(android.content.Context context,
java.lang.String token)
Manually pass the Firebase Device Token for Uninstall Tracking.
|
void |
validateAndTrackInAppPurchase(android.content.Context context,
java.lang.String publicKey,
java.lang.String signature,
java.lang.String purchaseData,
java.lang.String price,
java.lang.String currency,
java.util.Map<java.lang.String,java.lang.String> additionalParameters)
API for server verification of in-app purchases.
|
void |
waitForCustomerUserId(boolean wait)
It is possible to delay the SDK Initialization until the customerUserID is set.
|
public static final java.lang.String IS_STOP_TRACKING_USED
public static final java.lang.String PRE_INSTALL_SYSTEM_RO_PROP
public static final java.lang.String PRE_INSTALL_SYSTEM_DEFAULT
public static final java.lang.String PRE_INSTALL_SYSTEM_DEFAULT_ETC
public static final java.lang.String AF_PRE_INSTALL_PATH
public static final java.lang.String LOG_TAG
protected android.net.Uri latestDeepLink
public static AppsFlyerLibCore getInstance()
public void stopTracking(boolean isTrackingStopped,
android.content.Context context)
AppsFlyerLibstopTracking in class AppsFlyerLibisTrackingStopped - should tracking be stopped.context - Application / Activity context.public java.lang.String getSdkVersion()
AppsFlyerLibgetSdkVersion in class AppsFlyerLibpublic void onPause(android.content.Context context)
AppsFlyerLibonPause in class AppsFlyerLibpublic void updateServerUninstallToken(android.content.Context context,
java.lang.String token)
AppsFlyerLibupdateServerUninstallToken in class AppsFlyerLibcontext - Application / Activity context.token - Firebase Device Token.public void setDebugLog(boolean shouldEnable)
AppsFlyerLibsetDebugLog in class AppsFlyerLibshouldEnable - boolean.public void setImeiData(java.lang.String aImei)
AppsFlyerLibsetImeiData in class AppsFlyerLibaImei - device's IMEI.public void setOaidData(java.lang.String oaid)
AppsFlyerLibsetOaidData in class AppsFlyerLiboaid - device's OAID.public void setAndroidIdData(java.lang.String aAndroidId)
AppsFlyerLibsetAndroidIdData in class AppsFlyerLibaAndroidId - device's Android ID.public AppsFlyerLib enableLocationCollection(boolean flag)
AppsFlyerLibManifest.permission#ACCESS_COARSE_LOCATION
and Manifest.permission#ACCESS_FINE_LOCATION Manifest permissions.enableLocationCollection in class AppsFlyerLibflag - boolean.public void waitForCustomerUserId(boolean wait)
AppsFlyerLibwaitForCustomerUserId in class AppsFlyerLibwait - boolean.public void setCustomerIdAndTrack(java.lang.String id,
android.content.Context context)
AppsFlyerLibsetCustomerIdAndTrack in class AppsFlyerLibid - Customer ID for client.context - Application / Activity context.public java.lang.String getOutOfStore(android.content.Context context)
AppsFlyerLibgetOutOfStore in class AppsFlyerLibcontext - Application / Activity context.public void setOutOfStore(java.lang.String sourceName)
AppsFlyerLibsetOutOfStore in class AppsFlyerLibsourceName - value to be set.public void setAppInviteOneLink(java.lang.String oneLinkId)
AppsFlyerLibsetAppInviteOneLink in class AppsFlyerLiboneLinkId - OneLink ID obtained from the AppsFlyer Dashboard.public void setAdditionalData(java.util.HashMap<java.lang.String,java.lang.Object> customData)
AppsFlyerLibsetAdditionalData in class AppsFlyerLibcustomData - additional data HashMap.public void sendDeepLinkData(android.app.Activity activity)
AppsFlyerLibsendDeepLinkData in class AppsFlyerLibactivity - The Activity used for deep linking.public void sendPushNotificationData(android.app.Activity activity)
AppsFlyerLibsendPushNotificationData in class AppsFlyerLibactivity - The Activity which will be launched upon clicking the notification.public void setUserEmails(java.lang.String... emails)
AppsFlyerLibsetUserEmails in class AppsFlyerLibemails - User emails.public void setUserEmails(AppsFlyerProperties.EmailsCryptType cryptMethod, java.lang.String... emails)
AppsFlyerLibsetUserEmails in class AppsFlyerLibcryptMethod - Encryption method:
AppsFlyerProperties.EmailsCryptType.NONE,
AppsFlyerProperties.EmailsCryptType.SHA1,
AppsFlyerProperties.EmailsCryptType.MD5,
AppsFlyerProperties.EmailsCryptType.SHA256emails - User emails.public void setCollectAndroidID(boolean isCollect)
AppsFlyerLibsetCollectAndroidID in class AppsFlyerLibisCollect - boolean, false to opt-out.public void setCollectIMEI(boolean isCollect)
AppsFlyerLibsetCollectIMEI in class AppsFlyerLibisCollect - boolean, false to opt-out.public void setCollectOaid(boolean isCollect)
AppsFlyerLibsetCollectOaid in class AppsFlyerLibisCollect - boolean, true to opt-in.public void setResolveDeepLinkURLs(java.lang.String... urls)
AppsFlyerLib
setResolveDeepLinkURLs API allows to Appsflyer SDK to resolve
provided urls, to be able to deep link from a OneLink
wrapped within another Universal Link and also track this retargeting
conversion.
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
setResolveDeepLinkURLs in class AppsFlyerLiburls - - Array of urlspublic void setOneLinkCustomDomain(java.lang.String... domains)
setOneLinkCustomDomain in class AppsFlyerLibpublic AppsFlyerLib init(java.lang.String key, AppsFlyerConversionListener conversionDataListener)
init in class AppsFlyerLibkey - AppsFlyer's Dev-Key, which is accessible from your AppsFlyer account,
under 'App Settings' in the dashboard.conversionDataListener - (Optional) implement the ConversionDataListener to
access AppsFlyer's conversion data. Can be null.public AppsFlyerLib init(java.lang.String key, AppsFlyerConversionListener conversionDataListener, android.content.Context context)
AppsFlyerLibAppsFlyerLib.init(String, AppsFlyerConversionListener)
with additional argument Context to handle new install referrerinit in class AppsFlyerLibpublic void enableFacebookDeferredApplinks(boolean isEnabled)
AppsFlyerLibenableFacebookDeferredApplinks in class AppsFlyerLibisEnabled - should Facebook's deferred app links be processed by the AppsFlyer SDK.public void startTracking(android.app.Application application)
AppsFlyerLibAppsFlyerLib.startTracking(Application, String)startTracking in class AppsFlyerLibapplication - the Application object which is used for registering
for the app's life-cyclepublic void startTracking(android.app.Application application,
java.lang.String key)
AppsFlyerLibstartTracking in class AppsFlyerLibapplication - the Application object which is used for registering
for the app's life-cyclekey - AppsFlyer's Dev-Key, which is accessible from your AppsFlyer account,
under 'App Settings' in the dashboard.public void startTracking(android.app.Application application,
java.lang.String key,
AppsFlyerTrackingRequestListener onTrackingRequestListener)
AppsFlyerLibstartTracking in class AppsFlyerLibapplication - the Application object which is used for registering
for the app's life-cyclekey - AppsFlyer's Dev-Key, which is accessible from your AppsFlyer
account, under 'App Settings' in the dashboard.onTrackingRequestListener - An optional listener for getting the request status -
A 200 OK response from server will invoke the
onTrackingRequestSuccess() method
onTrackingRequestFailure(String error) will return the error
in case one occurspublic void setCustomerUserId(java.lang.String id)
AppsFlyerLibsetCustomerUserId in class AppsFlyerLibid - Customer ID for client.public void setPhoneNumber(java.lang.String phoneNumber)
AppsFlyerLibsetPhoneNumber in class AppsFlyerLibpublic void setAppId(java.lang.String id)
setAppId in class AppsFlyerLibpublic void setExtension(java.lang.String extension)
AppsFlyerLibsetExtension in class AppsFlyerLibpublic void setIsUpdate(boolean isUpdate)
AppsFlyerLibsetIsUpdate in class AppsFlyerLibisUpdate - boolean valuepublic void setCurrencyCode(java.lang.String currencyCode)
AppsFlyerLibsetCurrencyCode in class AppsFlyerLibcurrencyCode - 3 character ISO 4217 codepublic void trackLocation(android.content.Context context,
double latitude,
double longitude)
AppsFlyerLibtrackLocation in class AppsFlyerLibcontext - Application / Activity contextlatitude - latitude as doublelongitude - longitude as doublepublic void trackAppLaunch(android.content.Context ctx,
java.lang.String devKey)
AppsFlyerLibtrackAppLaunch in class AppsFlyerLibctx - Application / Activity contextdevKey - AppsFlyer's Dev-Key, which is accessible from your AppsFlyer account,
under 'App Settings' in the dashboard.protected void setDeepLinkData(android.content.Intent intent)
public void setPluginDeepLinkData(android.content.Intent intent)
setPluginDeepLinkData in class AppsFlyerLibintent - public void reportTrackSession(android.content.Context ctx)
AppsFlyerLibreportTrackSession in class AppsFlyerLibctx - Application / Activity contextpublic void trackEvent(android.content.Context context,
java.lang.String eventName,
java.util.Map<java.lang.String,java.lang.Object> eventValues,
AppsFlyerTrackingRequestListener listener)
AppsFlyerLibAppsFlyerLib.trackEvent(Context, String, Map) with
AppsFlyerTrackingRequestListener. HttpURLConnection.HTTP_OK from
server will invoke the AppsFlyerTrackingRequestListener.onTrackingRequestSuccess()
method. AppsFlyerTrackingRequestListener.onTrackingRequestFailure(String) will return
the error in case one occurstrackEvent in class AppsFlyerLibpublic void trackEvent(android.content.Context context,
java.lang.String eventName,
java.util.Map<java.lang.String,java.lang.Object> eventValues)
AppsFlyerLibtrackEvent in class AppsFlyerLibcontext - Application / Activity contexteventName - Event Name as StringeventValues - Event Values as Mappublic void setDeviceTrackingDisabled(boolean isDisabled)
AppsFlyerLibsetDeviceTrackingDisabled in class AppsFlyerLibisDisabled - booleanpublic void registerConversionListener(android.content.Context context,
AppsFlyerConversionListener conversionDataListener)
AppsFlyerLibregisterConversionListener in class AppsFlyerLibcontext - Application / Activity contextconversionDataListener - AppsFlyerConversionListener interface with
onInstallConversionDataLoaded and onAppOpenAttribution callback methods.public void unregisterConversionListener()
AppsFlyerLibunregisterConversionListener in class AppsFlyerLibpublic void registerValidatorListener(android.content.Context context,
AppsFlyerInAppPurchaseValidatorListener validationListener)
AppsFlyerLibAppsFlyerLib.validateAndTrackInAppPurchase(android.content.Context, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map<java.lang.String, java.lang.String>) API.registerValidatorListener in class AppsFlyerLibcontext - Application / Activity context.validationListener - AppsFlyerInAppPurchaseValidatorListener interface with \
onValidateInApp and onValidateInAppFailure callback methodsprotected void getConversionData(android.content.Context context,
ConversionDataListener conversionDataListener)
public void setConsumeAFDeepLinks(boolean doConsume)
AppsFlyerLibsetConsumeAFDeepLinks in class AppsFlyerLibdoConsume - booleanprotected void handleDeepLinkCallback(android.content.Context context,
java.util.Map<java.lang.String,java.lang.Object> params,
android.net.Uri uri)
public void setPreinstallAttribution(java.lang.String mediaSource,
java.lang.String campaign,
java.lang.String siteId)
AppsFlyerLibsetPreinstallAttribution in class AppsFlyerLibmediaSource - Manufacturer or media source name for preinstall attribution.campaign - Campaign name for preinstall attribution.siteId - Site ID for preinstall attribution.public boolean isPreInstalledApp(android.content.Context context)
AppsFlyerLibisPreInstalledApp in class AppsFlyerLibcontext - Application / Activity context.public java.lang.String getAttributionId(android.content.Context context)
AppsFlyerLibgetAttributionId in class AppsFlyerLibpublic java.lang.String getAppsFlyerUID(android.content.Context context)
AppsFlyerLibgetAppsFlyerUID in class AppsFlyerLibcontext - Application / Activity context.public void validateAndTrackInAppPurchase(android.content.Context context,
java.lang.String publicKey,
java.lang.String signature,
java.lang.String purchaseData,
java.lang.String price,
java.lang.String currency,
java.util.Map<java.lang.String,java.lang.String> additionalParameters)
AppsFlyerLibvalidateAndTrackInAppPurchase in class AppsFlyerLibcontext - Application / Activity context.publicKey - License Key obtained from the Google Play Console.signature - data.INAPP_DATA_SIGNATURE from onActivityResult(int requestCode, int resultCode, Intent data)purchaseData - data.INAPP_PURCHASE_DATA from onActivityResult(int requestCode, int resultCode, Intent data)price - Purchase price, should be derived from skuDetails.getStringArrayList("DETAILS_LIST")currency - Purchase currency, should be derived from skuDetails.getStringArrayList("DETAILS_LIST")additionalParameters - Freehand parameters to be tracked with the purchase (if validated).public void onHandleReferrer(java.util.Map<java.lang.String,java.lang.String> referrer)
AppsFlyerLibonHandleReferrer in class AppsFlyerLibreferrer - NA.public boolean isTrackingStopped()
AppsFlyerLibAppsFlyerLib.stopTracking(boolean, Context) API set to true.isTrackingStopped in class AppsFlyerLibpublic void setLogLevel(AFLogger.LogLevel logLevel)
AppsFlyerLibsetLogLevel in class AppsFlyerLiblogLevel - logLevel as String:
AFLogger.LogLevel.NONE,
AFLogger.LogLevel.ERROR,
AFLogger.LogLevel.WARNING,
AFLogger.LogLevel.INFO,
AFLogger.LogLevel.DEBUG,
AFLogger.LogLevel.VERBOSE.public void setHost(java.lang.String hostPrefixName,
java.lang.String hostName)
AppsFlyerLibsetHost in class AppsFlyerLibhostPrefixName - Host prefix.hostName - Host name.public java.lang.String getHostName()
AppsFlyerLibgetHostName in class AppsFlyerLib@Deprecated public void setHostName(java.lang.String hostname)
setHostName in class AppsFlyerLibpublic java.lang.String getHostPrefix()
AppsFlyerLibgetHostPrefix in class AppsFlyerLibpublic void setMinTimeBetweenSessions(int seconds)
AppsFlyerLibsetMinTimeBetweenSessions in class AppsFlyerLibseconds - minimum time between 2 separate sessions in seconds.