Package com.adjust.sdk
Class AdjustInstance
- java.lang.Object
-
- com.adjust.sdk.AdjustInstance
-
public class AdjustInstance extends java.lang.Object
Class used to forward instructions to SDK which user gives as part of Adjust class interface.- Since:
- 12th April 2014
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AdjustInstance.PreLaunchActions
-
Constructor Summary
Constructors Constructor Description AdjustInstance()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.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.void
appWillOpenUrl(android.net.Uri url)
Called to process deep link.void
appWillOpenUrl(android.net.Uri url, android.content.Context context)
Called to process deep link.void
disableThirdPartySharing(android.content.Context context)
Called to disable the third party sharing.void
gdprForgetMe(android.content.Context context)
Called to forget the user in accordance with GDPR law.java.lang.String
getAdid()
Called to get value of unique Adjust device identifier.AdjustAttribution
getAttribution()
Called to get user's current attribution value.java.lang.String
getSdkVersion()
Called to get native SDK version string.boolean
isEnabled()
Get information if SDK is enabled or not.void
onCreate(AdjustConfig adjustConfig)
Called upon SDK initialisation.void
onPause()
Called upon each Activity's onPause() method call.void
onResume()
Called upon each Activity's onResume() method call.void
removeSessionCallbackParameter(java.lang.String key)
Called to remove global callback parameter from session and event packages.void
removeSessionPartnerParameter(java.lang.String key)
Called to remove global partner parameter from session and event packages.void
resetSessionCallbackParameters()
Called to remove all added global callback parameters.void
resetSessionPartnerParameters()
Called to remove all added global partner parameters.void
sendFirstPackages()
Called if SDK initialisation was delayed and you would like to stop waiting for timer.void
sendPreinstallReferrer(java.lang.String referrer, android.content.Context context)
Called to process preinstall payload information sent with SYSTEM_INSTALLER_REFERRER intent.void
sendReferrer(java.lang.String rawReferrer, android.content.Context context)
Called to process referrer information sent with INSTALL_REFERRER intent.void
setEnabled(boolean enabled)
Called to disable/enable SDK.void
setOfflineMode(boolean enabled)
Called to set SDK to offline or online mode.void
setPushToken(java.lang.String token)
Called to set user's push notifications token.void
setPushToken(java.lang.String token, android.content.Context context)
Called to set user's push notifications token.void
setTestOptions(AdjustTestOptions testOptions)
Used for testing purposes only.void
teardown()
Called to teardown SDK state.void
trackAdRevenue(AdjustAdRevenue adjustAdRevenue)
Track ad revenue from a source providervoid
trackAdRevenue(java.lang.String source, org.json.JSONObject adRevenueJson)
Track ad revenue from a source providervoid
trackEvent(AdjustEvent event)
Called to track event.void
trackMeasurementConsent(boolean consentMeasurement)
void
trackPlayStoreSubscription(AdjustPlayStoreSubscription subscription)
Track subscription from Google Play.void
trackThirdPartySharing(AdjustThirdPartySharing adjustThirdPartySharing)
void
verifyPurchase(AdjustPurchase purchase, OnPurchaseVerificationFinishedListener callback)
Verify in app purchase from Google Play.
-
-
-
Method Detail
-
onCreate
public void onCreate(AdjustConfig adjustConfig)
Called upon SDK initialisation.- Parameters:
adjustConfig
- AdjustConfig object used for SDK initialisation
-
trackEvent
public void trackEvent(AdjustEvent event)
Called to track event.- Parameters:
event
- AdjustEvent object to be tracked
-
onResume
public void onResume()
Called upon each Activity's onResume() method call.
-
onPause
public void onPause()
Called upon each Activity's onPause() method call.
-
setEnabled
public void setEnabled(boolean enabled)
Called to disable/enable SDK.- Parameters:
enabled
- boolean indicating whether SDK should be enabled or disabled
-
isEnabled
public boolean isEnabled()
Get information if SDK is enabled or not.- Returns:
- boolean indicating whether SDK is enabled or not
-
appWillOpenUrl
public void appWillOpenUrl(android.net.Uri url)
Called to process deep link.- Parameters:
url
- Deep link URL to process
-
appWillOpenUrl
public void appWillOpenUrl(android.net.Uri url, android.content.Context context)
Called to process deep link.- Parameters:
url
- Deep link URL to processcontext
- Application context
-
sendReferrer
public void sendReferrer(java.lang.String rawReferrer, android.content.Context context)
Called to process referrer information sent with INSTALL_REFERRER intent.- Parameters:
rawReferrer
- Raw referrer contentcontext
- Application context
-
sendPreinstallReferrer
public void sendPreinstallReferrer(java.lang.String referrer, android.content.Context context)
Called to process preinstall payload information sent with SYSTEM_INSTALLER_REFERRER intent.- Parameters:
referrer
- Preinstall referrer contentcontext
- Application context
-
setOfflineMode
public 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 void sendFirstPackages()
Called if SDK initialisation was delayed and you would like to stop waiting for timer.
-
addSessionCallbackParameter
public 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 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 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 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 void resetSessionCallbackParameters()
Called to remove all added global callback parameters.
-
resetSessionPartnerParameters
public void resetSessionPartnerParameters()
Called to remove all added global partner parameters.
-
teardown
public void teardown()
Called to teardown SDK state. Used only for Adjust tests, shouldn't be used in client apps.
-
setPushToken
public void setPushToken(java.lang.String token)
Called to set user's push notifications token.- Parameters:
token
- Push notifications token
-
setPushToken
public 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 void gdprForgetMe(android.content.Context context)
Called to forget the user in accordance with GDPR law.- Parameters:
context
- Application context
-
disableThirdPartySharing
public void disableThirdPartySharing(android.content.Context context)
Called to disable the third party sharing.- Parameters:
context
- Application context
-
trackThirdPartySharing
public void trackThirdPartySharing(AdjustThirdPartySharing adjustThirdPartySharing)
-
trackMeasurementConsent
public void trackMeasurementConsent(boolean consentMeasurement)
-
trackAdRevenue
public void trackAdRevenue(java.lang.String source, org.json.JSONObject adRevenueJson)
Track ad revenue from a source provider- Parameters:
source
- Source of ad revenue information, see AdjustConfig.AD_REVENUE_* for some possible sourcesadRevenueJson
- JsonObject content of the ad revenue information
-
trackAdRevenue
public void trackAdRevenue(AdjustAdRevenue adjustAdRevenue)
Track ad revenue from a source provider- Parameters:
adjustAdRevenue
- Adjust ad revenue information like source, revenue, currency etc
-
trackPlayStoreSubscription
public void trackPlayStoreSubscription(AdjustPlayStoreSubscription subscription)
Track subscription from Google Play.- Parameters:
subscription
- AdjustPlayStoreSubscription object to be tracked
-
getAdid
public java.lang.String getAdid()
Called to get value of unique Adjust device identifier.- Returns:
- Unique Adjust device indetifier
-
getAttribution
public AdjustAttribution getAttribution()
Called to get user's current attribution value.- Returns:
- AdjustAttribution object with current attribution value
-
getSdkVersion
public java.lang.String getSdkVersion()
Called to get native SDK version string.- Returns:
- Native SDK version string.
-
verifyPurchase
public void verifyPurchase(AdjustPurchase purchase, OnPurchaseVerificationFinishedListener callback)
Verify in app purchase from Google Play.- Parameters:
purchase
- AdjustPurchase object to be verifiedcallback
- Callback to be pinged with the verification results
-
setTestOptions
public void setTestOptions(AdjustTestOptions testOptions)
Used for testing purposes only. Do NOT use this method.- Parameters:
testOptions
- Adjust integration tests options
-
-