Package com.adjust.sdk
Class Adjust
- java.lang.Object
-
- com.adjust.sdk.Adjust
-
public class Adjust extends java.lang.Object
The main interface to Adjust. Use the methods of this class to tell Adjust about the usage of your app. See the README for details.- Since:
- 11th November 2011
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
addSessionCallbackParameter(java.lang.String key, java.lang.String value)
Called to add global callback parameter that will be sent with each session and event.static void
addSessionPartnerParameter(java.lang.String key, java.lang.String value)
Called to add global partner parameter that will be sent with each session and event.static void
appWillOpenUrl(android.net.Uri url)
Deprecated.UseappWillOpenUrl(Uri, Context)
} instead.static void
appWillOpenUrl(android.net.Uri url, android.content.Context context)
Called to process deep link.static void
disableThirdPartySharing(android.content.Context context)
Called to disable the third party sharing.static void
gdprForgetMe(android.content.Context context)
Called to forget the user in accordance with GDPR law.static java.lang.String
getAdid()
Called to get value of unique Adjust device identifier.static java.lang.String
getAmazonAdId(android.content.Context context)
Called to get value of Amazon Advertising Identifier.static AdjustAttribution
getAttribution()
Called to get user's current attribution value.static AdjustInstance
getDefaultInstance()
Method used to obtain Adjust SDK singleton instance.static void
getGoogleAdId(android.content.Context context, OnDeviceIdsRead onDeviceIdRead)
Called to get value of Google Play Advertising Identifier.static java.lang.String
getSdkVersion()
Called to get native SDK version string.static boolean
isAdjustUninstallDetectionPayload(java.util.Map<java.lang.String,java.lang.String> payload)
Get information if the payload originates from Adjust.static boolean
isEnabled()
Get information if SDK is enabled or not.static void
onCreate(AdjustConfig adjustConfig)
Called upon SDK initialisation.static void
onPause()
Called upon each Activity's onPause() method call.static void
onResume()
Called upon each Activity's onResume() method call.static void
removeSessionCallbackParameter(java.lang.String key)
Called to remove global callback parameter from session and event packages.static void
removeSessionPartnerParameter(java.lang.String key)
Called to remove global partner parameter from session and event packages.static void
resetSessionCallbackParameters()
Called to remove all added global callback parameters.static void
resetSessionPartnerParameters()
Called to remove all added global partner parameters.static void
sendFirstPackages()
Called if SDK initialisation was delayed and you would like to stop waiting for timer.static void
setEnabled(boolean enabled)
Called to disable/enable SDK.static void
setOfflineMode(boolean enabled)
Called to set SDK to offline or online mode.static void
setPushToken(java.lang.String token)
Deprecated.usesetPushToken(String, Context)
instead.static void
setPushToken(java.lang.String token, android.content.Context context)
Called to set user's push notifications token.static void
setReferrer(java.lang.String referrer, android.content.Context context)
Called to process referrer information sent with INSTALL_REFERRER intent.static void
setTestOptions(AdjustTestOptions testOptions)
Used for testing purposes only.static void
trackAdRevenue(AdjustAdRevenue adjustAdRevenue)
Track ad revenue from a source providerstatic void
trackAdRevenue(java.lang.String source, org.json.JSONObject payload)
Track ad revenue from a source providerstatic void
trackEvent(AdjustEvent event)
Called to track event.static void
trackMeasurementConsent(boolean consentMeasurement)
static void
trackPlayStoreSubscription(AdjustPlayStoreSubscription subscription)
Track subscription from Google Play.static void
trackThirdPartySharing(AdjustThirdPartySharing adjustThirdPartySharing)
-
-
-
Method Detail
-
getDefaultInstance
public static AdjustInstance getDefaultInstance()
Method used to obtain Adjust SDK singleton instance.- Returns:
- Adjust SDK singleton instance.
-
onCreate
public static void onCreate(AdjustConfig adjustConfig)
Called upon SDK initialisation.- Parameters:
adjustConfig
- AdjustConfig object used for SDK initialisation
-
trackEvent
public static void trackEvent(AdjustEvent event)
Called to track event.- Parameters:
event
- AdjustEvent object to be tracked
-
onResume
public static void onResume()
Called upon each Activity's onResume() method call.
-
onPause
public static void onPause()
Called upon each Activity's onPause() method call.
-
setEnabled
public static void setEnabled(boolean enabled)
Called to disable/enable SDK.- Parameters:
enabled
- boolean indicating whether SDK should be enabled or disabled
-
isEnabled
public static boolean isEnabled()
Get information if SDK is enabled or not.- Returns:
- boolean indicating whether SDK is enabled or not
-
isAdjustUninstallDetectionPayload
public static boolean isAdjustUninstallDetectionPayload(java.util.Map<java.lang.String,java.lang.String> payload)
Get information if the payload originates from Adjust.- Returns:
- boolean indicating whether payload originates from Adjust or not.
-
appWillOpenUrl
@Deprecated public static void appWillOpenUrl(android.net.Uri url)
Deprecated.UseappWillOpenUrl(Uri, Context)
} instead.Called to process deep link.- Parameters:
url
- Deep link URL to process
-
appWillOpenUrl
public static void appWillOpenUrl(android.net.Uri url, android.content.Context context)
Called to process deep link.- Parameters:
url
- Deep link URL to processcontext
- Application context
-
setReferrer
public static void setReferrer(java.lang.String referrer, android.content.Context context)
Called to process referrer information sent with INSTALL_REFERRER intent.- Parameters:
referrer
- Referrer contentcontext
- Application context
-
setOfflineMode
public static void setOfflineMode(boolean enabled)
Called to set SDK to offline or online mode.- Parameters:
enabled
- boolean indicating should SDK be in offline mode (true) or not (false)
-
sendFirstPackages
public static void sendFirstPackages()
Called if SDK initialisation was delayed and you would like to stop waiting for timer.
-
addSessionCallbackParameter
public static void addSessionCallbackParameter(java.lang.String key, java.lang.String value)
Called to add global callback parameter that will be sent with each session and event.- Parameters:
key
- Global callback parameter keyvalue
- Global callback parameter value
-
addSessionPartnerParameter
public static void addSessionPartnerParameter(java.lang.String key, java.lang.String value)
Called to add global partner parameter that will be sent with each session and event.- Parameters:
key
- Global partner parameter keyvalue
- Global partner parameter value
-
removeSessionCallbackParameter
public static void removeSessionCallbackParameter(java.lang.String key)
Called to remove global callback parameter from session and event packages.- Parameters:
key
- Global callback parameter key
-
removeSessionPartnerParameter
public static void removeSessionPartnerParameter(java.lang.String key)
Called to remove global partner parameter from session and event packages.- Parameters:
key
- Global partner parameter key
-
resetSessionCallbackParameters
public static void resetSessionCallbackParameters()
Called to remove all added global callback parameters.
-
resetSessionPartnerParameters
public static void resetSessionPartnerParameters()
Called to remove all added global partner parameters.
-
setPushToken
public static void setPushToken(java.lang.String token)
Deprecated.usesetPushToken(String, Context)
instead.Called to set user's push notifications token.- Parameters:
token
- Push notifications token
-
setPushToken
public static void setPushToken(java.lang.String token, android.content.Context context)
Called to set user's push notifications token.- Parameters:
token
- Push notifications tokencontext
- Application context
-
gdprForgetMe
public static void gdprForgetMe(android.content.Context context)
Called to forget the user in accordance with GDPR law.- Parameters:
context
- Application context
-
disableThirdPartySharing
public static void disableThirdPartySharing(android.content.Context context)
Called to disable the third party sharing.- Parameters:
context
- Application context
-
trackThirdPartySharing
public static void trackThirdPartySharing(AdjustThirdPartySharing adjustThirdPartySharing)
-
trackMeasurementConsent
public static void trackMeasurementConsent(boolean consentMeasurement)
-
trackAdRevenue
public static void trackAdRevenue(java.lang.String source, org.json.JSONObject payload)
Track ad revenue from a source provider- Parameters:
source
- Source of ad revenue information, see AdjustConfig.AD_REVENUE_* for some possible sourcespayload
- JsonObject content of the ad revenue information
-
trackAdRevenue
public static void trackAdRevenue(AdjustAdRevenue adjustAdRevenue)
Track ad revenue from a source provider- Parameters:
adjustAdRevenue
- Adjust ad revenue information like source, revenue, currency etc
-
trackPlayStoreSubscription
public static void trackPlayStoreSubscription(AdjustPlayStoreSubscription subscription)
Track subscription from Google Play.- Parameters:
subscription
- AdjustPlayStoreSubscription object to be tracked
-
getGoogleAdId
public static void getGoogleAdId(android.content.Context context, OnDeviceIdsRead onDeviceIdRead)
Called to get value of Google Play Advertising Identifier.- Parameters:
context
- Application contextonDeviceIdRead
- Callback to get triggered once identifier is obtained
-
getAmazonAdId
public static java.lang.String getAmazonAdId(android.content.Context context)
Called to get value of Amazon Advertising Identifier.- Parameters:
context
- Application context- Returns:
- Amazon Advertising Identifier
-
getAdid
public static java.lang.String getAdid()
Called to get value of unique Adjust device identifier.- Returns:
- Unique Adjust device indetifier
-
getAttribution
public static AdjustAttribution getAttribution()
Called to get user's current attribution value.- Returns:
- AdjustAttribution object with current attribution value
-
getSdkVersion
public static java.lang.String getSdkVersion()
Called to get native SDK version string.- Returns:
- Native SDK version string.
-
setTestOptions
public static void setTestOptions(AdjustTestOptions testOptions)
Used for testing purposes only. Do NOT use this method.- Parameters:
testOptions
- Adjust integration tests options
-
-