Package io.adtrace.sdk
Class AdTraceInstance
java.lang.Object
io.adtrace.sdk.AdTraceInstance
AdTrace android SDK (https://adtrace.io)
Created by Nasser Amini (github.com/namini40) on April 2022.
Notice: See LICENSE.txt for modification and distribution information
Copyright © 2022.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSessionCallbackParameter(String key, String value) Called to add global callback parameter that will be sent with each session and event.voidaddSessionPartnerParameter(String key, String value) Called to add global partner parameter that will be sent with each session and event.voidappWillOpenUrl(android.net.Uri url) Called to process deep link.voidappWillOpenUrl(android.net.Uri url, android.content.Context context) Called to process deep link.voiddisableThirdPartySharing(android.content.Context context) Called to disable the third party sharing.voidgdprForgetMe(android.content.Context context) Called to forget the user in accordance with GDPR law.getAdid()Called to get value of unique AdTrace device identifier.Called to get user's current attribution value.Called to get native SDK version string.booleanGet information if SDK is enabled or not.voidonCreate(AdTraceConfig adTraceConfig) Called upon SDK initialisation.voidonPause()Called upon each Activity's onPause() method call.voidonResume()Called upon each Activity's onResume() method call.voidCalled to remove global callback parameter from session and event packages.voidCalled to remove global partner parameter from session and event packages.voidCalled to remove all added global callback parameters.voidCalled to remove all added global partner parameters.voidCalled if SDK initialisation was delayed and you would like to stop waiting for timer.voidsendPreinstallReferrer(String referrer, android.content.Context context) Called to process preinstall payload information sent with SYSTEM_INSTALLER_REFERRER intent.voidsendReferrer(String rawReferrer, android.content.Context context) Called to process referrer information sent with INSTALL_REFERRER intent.voidsetEnabled(boolean enabled) Called to disable/enable SDK.voidsetOfflineMode(boolean enabled) Called to set SDK to offline or online mode.voidsetPushToken(String token) Called to set user's push notifications token.voidsetPushToken(String token, android.content.Context context) Called to set user's push notifications token.voidsetTestOptions(AdTraceTestOptions testOptions) Used for testing purposes only.voidteardown()Called to teardown SDK state.voidtrackAdRevenue(AdTraceAdRevenue adTraceAdRevenue) Track ad revenue from a source providervoidtrackAdRevenue(String source, org.json.JSONObject adRevenueJson) Track ad revenue from a source providervoidtrackEvent(AdTraceEvent event) Called to track event.voidtrackMeasurementConsent(boolean consentMeasurement) voidtrackPlayStoreSubscription(AdTracePlayStoreSubscription subscription) Track subscription from Google Play.voidtrackThirdPartySharing(AdTraceThirdPartySharing adTraceThirdPartySharing)
-
Constructor Details
-
AdTraceInstance
public AdTraceInstance()
-
-
Method Details
-
onCreate
Called upon SDK initialisation.- Parameters:
adTraceConfig- AdTraceConfig object used for SDK initialisation
-
trackEvent
Called to track event.- Parameters:
event- AdTraceEvent 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
Called to process referrer information sent with INSTALL_REFERRER intent.- Parameters:
rawReferrer- Raw referrer contentcontext- Application context
-
sendPreinstallReferrer
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
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
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
Called to remove global callback parameter from session and event packages.- Parameters:
key- Global callback parameter key
-
removeSessionPartnerParameter
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 AdTrace tests, shouldn't be used in client apps. -
setPushToken
Called to set user's push notifications token.- Parameters:
token- Push notifications token
-
setPushToken
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
-
trackMeasurementConsent
public void trackMeasurementConsent(boolean consentMeasurement) -
trackAdRevenue
Track ad revenue from a source provider- Parameters:
source- Source of ad revenue information, see AdTraceConfig.AD_REVENUE_* for some possible sourcesadRevenueJson- JsonObject content of the ad revenue information
-
trackAdRevenue
Track ad revenue from a source provider- Parameters:
adTraceAdRevenue- AdTrace ad revenue information like source, revenue, currency etc
-
trackPlayStoreSubscription
Track subscription from Google Play.- Parameters:
subscription- AdTracePlayStoreSubscription object to be tracked
-
getAdid
Called to get value of unique AdTrace device identifier.- Returns:
- Unique AdTrace device indetifier
-
getAttribution
Called to get user's current attribution value.- Returns:
- AdTraceAttribution object with current attribution value
-
getSdkVersion
Called to get native SDK version string.- Returns:
- Native SDK version string.
-
setTestOptions
Used for testing purposes only. Do NOT use this method.- Parameters:
testOptions- AdTrace integration tests options
-