public class Tune extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
collectLocation |
protected TuneEventQueue |
eventQueue |
protected boolean |
initialized |
protected boolean |
isRegistered |
protected TuneLocationListener |
locationListener |
protected Context |
mContext |
protected BroadcastReceiver |
networkStateReceiver |
protected TuneParameters |
params |
protected ExecutorService |
pubQueue |
protected TuneTestRequest |
tuneRequest |
Modifier | Constructor and Description |
---|---|
protected |
Tune() |
Modifier and Type | Method and Description |
---|---|
protected void |
addEventToQueue(String link,
String data,
JSONObject postBody,
boolean firstSession) |
void |
checkForDeferredDeeplink(TuneDeeplinkListener listener)
Checks for a deferred deeplink if exists
Opens deferred deeplink if found and returns value in TuneDeeplinkListener
|
static void |
clear()
Clear Tune singleton so it may be re-initialized.
|
void |
clearAllCustomProfileVariables()
Clear out all previously specified profile information.
Use this method to clear out all custom profile variables. |
void |
clearCustomProfileVariable(String variableName)
Unset the value for a user profile variable.
Use this method to clear out the value for any custom user profile variable. |
boolean |
didUserManuallyDisablePush()
Returns if the user manually disabled push on the Application Setting page.
|
protected void |
dumpQueue() |
String |
getAction()
Gets the action of the event
|
String |
getAdvertiserId()
Gets the TUNE advertiser ID.
|
int |
getAge()
Gets the user age set.
|
double |
getAltitude()
Gets the device altitude.
|
String |
getAndroidId()
Gets the ANDROID_ID of the device
|
boolean |
getAppAdTrackingEnabled()
Get whether the user has app-level ad tracking enabled or not.
|
String |
getAppName()
Gets the app name
|
int |
getAppVersion()
Gets the app version
|
String |
getConnectionType()
Gets the connection type (mobile or WIFI);.
|
String |
getCountryCode()
Gets the ISO 639-1 country code
|
String |
getCurrencyCode()
Gets the ISO 4217 currency code.
|
Date |
getCustomProfileDate(String variableName)
Get the value associated with a custom date profile variable.
|
TuneLocation |
getCustomProfileGeolocation(String variableName)
Get the value associated with a custom location profile variable.
|
Number |
getCustomProfileNumber(String variableName)
Get the value associated with a custom number profile variable.
|
String |
getCustomProfileString(String variableName)
Get the value associated with a custom string profile variable.
|
String |
getDeviceBrand()
Gets the device brand/manufacturer (HTC, Apple, etc)
|
String |
getDeviceCarrier()
Gets the device carrier if any
|
String |
getDeviceId()
Gets the Device ID, also known as IMEI/MEID, if any
|
String |
getDeviceModel()
Gets the device model name
|
String |
getDeviceToken()
Returns the currently registered device token for push.
|
boolean |
getExistingUser()
Gets value previously set of existing user or not.
|
String |
getFacebookUserId()
Gets the Facebook user ID previously set.
|
TuneGender |
getGender()
Gets the user gender set.
|
boolean |
getGoogleAdTrackingLimited()
Gets whether use of the Google Play Services Advertising ID is limited by user request.
|
String |
getGoogleAdvertisingId()
Gets the Google Play Services Advertising ID.
|
String |
getGoogleUserId()
Gets the Google user ID previously set.
|
Map<String,TuneInAppMessageExperimentDetails> |
getInAppMessageExperimentDetails()
Get details for all currently running In App Message experiments.
|
long |
getInstallDate()
Gets the date of app install
|
String |
getInstallReferrer()
Gets the Google Play INSTALL_REFERRER
|
static Tune |
getInstance()
Get existing TUNE singleton object
|
boolean |
getIsPayingUser()
Gets whether the user is revenue-generating or not
|
String |
getLanguage()
Gets the language of the device
|
String |
getLastOpenLogId()
Gets the last TUNE open log ID
|
double |
getLatitude()
Gets the device latitude.
|
double |
getLongitude()
Gets the device longitude.
|
String |
getMacAddress()
Gets the MAC address of device
|
String |
getMatId()
Gets the MAT ID generated on install
|
String |
getMCC()
Gets the mobile country code.
|
String |
getMNC()
Gets the mobile network code.
|
String |
getOpenLogId()
Gets the first TUNE open log ID
|
String |
getOsVersion()
Gets the Android OS version
|
String |
getPackageName()
Gets the app package name
|
String |
getPluginName()
Get SDK plugin name used
|
Map<String,TunePowerHookExperimentDetails> |
getPowerHookExperimentDetails()
Get details for all currently running Power Hook Variable experiments.
|
String |
getReferralSource()
Gets the package name of the app that started this Activity, if any
|
String |
getReferralUrl()
Gets the url scheme that started this Activity, if any
|
String |
getRefId()
Gets the advertiser ref ID.
|
Double |
getRevenue()
Gets the revenue amount set
|
String |
getScreenDensity()
Gets the screen density of the device
|
String |
getScreenHeight()
Gets the screen height of the device in pixels
|
String |
getScreenWidth()
Gets the screen width of the device in pixels
|
String |
getSDKVersion()
Gets the TUNE SDK version
|
String |
getTRUSTeId()
Gets the TRUSTe ID set
|
String |
getTwitterUserId()
Gets the Twitter user ID previously set.
|
String |
getUserAgent()
Gets the device browser user agent
|
String |
getUserEmail()
Gets the custom user email.
|
String |
getUserId()
Gets the custom user ID.
|
String |
getUserName()
Gets the custom user name.
|
String |
getValueForHookById(String hookId)
Gets the value of a Power Hook.
|
static Tune |
init(Context context,
String advertiserId,
String conversionKey)
Initializes the TUNE SDK with TMA off by default.
|
static Tune |
init(Context context,
String advertiserId,
String conversionKey,
boolean turnOnTMA)
Initializes the TUNE SDK.
|
static Tune |
init(Context context,
String advertiserId,
String conversionKey,
boolean turnOnTMA,
TuneConfiguration configuration)
Initializes the TUNE SDK.
|
protected void |
initAll(String advertiserId,
String conversionKey)
Private initialization function for TUNE SDK.
|
boolean |
isInDebugMode()
Checks the current status of debug mode.
|
static boolean |
isOnline(Context context)
Returns true if an Internet connection is detected.
|
protected boolean |
makeRequest(String link,
String data,
JSONObject postBody)
Helper function for making single request and displaying response
|
void |
measureEvent(int eventId)
Event measurement function that measures an event for the given eventId.
|
void |
measureEvent(String eventName)
Event measurement function that measures an event for the given eventName.
|
void |
measureEvent(TuneEvent eventData)
Event measurement function that measures an event based on TuneEvent values.
|
void |
measureSession()
Main session measurement function; this function should be called in onResume().
|
void |
onFirstPlaylistDownloaded(TuneCallback callback)
Register callback when the very first playlist is downloaded.
|
void |
onFirstPlaylistDownloaded(TuneCallback callback,
long timeout)
Register callback when the very first playlist is downloaded.
|
void |
onPowerHooksChanged(TuneCallback callback)
Register a callback when any Power Hooks have changed due to a new value from the Server.
|
void |
registerCustomProfileDate(String variableName)
Register a custom profile variable for this user.
This custom variable will be included in this user's personalization profile, and can be used for segmentation, targeting, and reporting purposes. Once registered, the value for this variable can be set using setCustomProfileDate(String, Date) . |
void |
registerCustomProfileDate(String variableName,
Date defaultValue)
Register a custom profile variable for this user.
This custom variable will be included in this user's personalization profile, and can be used for segmentation, targeting, and reporting purposes. Once registered, the value for this variable can be set using setCustomProfileDate(String, Date) . |
void |
registerCustomProfileGeolocation(String variableName)
Register a custom profile variable for this user.
This custom variable will be included in this user's personalization profile, and can be used for segmentation, targeting, and reporting purposes. Once registered, the value for this variable can be set using setCustomProfileGeolocation(String, TuneLocation) . |
void |
registerCustomProfileGeolocation(String variableName,
TuneLocation defaultValue)
Register a custom profile variable for this user.
This custom variable will be included in this user's personalization profile, and can be used for segmentation, targeting, and reporting purposes. Once registered, the value for this variable can be set using setCustomProfileGeolocation(String, TuneLocation) . |
void |
registerCustomProfileNumber(String variableName)
Register a custom profile variable for this user.
This custom variable will be included in this user's personalization profile, and can be used for segmentation, targeting, and reporting purposes. Once registered, the value for this variable can be set using setCustomProfileNumber(String, double) , setCustomProfileNumber(String, float) , or setCustomProfileNumber(String, int) . |
void |
registerCustomProfileNumber(String variableName,
double defaultValue)
Register a custom profile variable for this user.
This custom variable will be included in this user's personalization profile, and can be used for segmentation, targeting, and reporting purposes. Once registered, the value for this variable can be set using setCustomProfileNumber(String, double) , setCustomProfileNumber(String, float) , or setCustomProfileNumber(String, int) . |
void |
registerCustomProfileNumber(String variableName,
float defaultValue)
Register a custom profile variable for this user.
This custom variable will be included in this user's personalization profile, and can be used for segmentation, targeting, and reporting purposes. Once registered, the value for this variable can be set using setCustomProfileNumber(String, double) , setCustomProfileNumber(String, float) , or setCustomProfileNumber(String, int) . |
void |
registerCustomProfileNumber(String variableName,
int defaultValue)
Register a custom profile variable for this user.
This custom variable will be included in this user's personalization profile, and can be used for segmentation, targeting, and reporting purposes. Once registered, the value for this variable can be set using setCustomProfileNumber(String, double) , setCustomProfileNumber(String, float) , or setCustomProfileNumber(String, int) . |
void |
registerCustomProfileString(String variableName)
Register a custom profile variable for this user.
This custom variable will be included in this user's personalization profile, and can be used for segmentation, targeting, and reporting purposes. Once registered, the value for this variable can be set using setCustomProfileStringValue(String, String) . |
void |
registerCustomProfileString(String variableName,
String defaultValue)
Register a custom profile variable for this user.
This custom variable will be included in this user's personalization profile, and can be used for segmentation, targeting, and reporting purposes. Once registered, the value for this variable can be set using setCustomProfileStringValue(String, String) . |
void |
registerDeepAction(String actionId,
String friendlyName,
Map<String,String> defaultData,
TuneDeepActionCallback action)
Registers a code-block Deep Action for use with TUNE.
|
void |
registerPowerHook(String hookId,
String friendlyName,
String defaultValue)
Registers a Power Hook for use with TUNE.
|
void |
setAdvertiserId(String advertiserId)
Sets the TUNE advertiser ID
|
void |
setAge(int age)
Sets the user's age.
|
void |
setAltitude(double altitude)
Sets the device altitude.
|
void |
setAndroidId(String androidId)
Sets the ANDROID ID
|
void |
setAndroidIdMd5(String androidIdMd5)
Sets the ANDROID ID MD5 hash
|
void |
setAndroidIdSha1(String androidIdSha1)
Sets the ANDROID ID SHA-1 hash
|
void |
setAndroidIdSha256(String androidIdSha256)
Sets the ANDROID ID SHA-256 hash
|
void |
setAppAdTrackingEnabled(boolean adTrackingEnabled)
Sets whether app-level ad tracking is enabled.
|
void |
setConversionKey(String conversionKey)
Sets the conversion key for the SDK
|
void |
setCurrencyCode(String currencyCode)
Sets the ISO 4217 currency code.
|
void |
setCustomProfileDate(String variableName,
Date value)
Set or update the value associated with a custom date profile variable.
This new value will be used as part of this user's personalization profile, and will be used from this point forward for segmentation, targeting, and reporting purposes. This can be called from anywhere in your app after the appropriate register call in Application.onCreate() . |
void |
setCustomProfileGeolocation(String variableName,
TuneLocation value)
Set or update the value associated with a custom location profile variable.
This new value will be used as part of this user's personalization profile, and will be used from this point forward for segmentation, targeting, and reporting purposes. This can be called from anywhere in your app after the appropriate register call in Application.onCreate() . |
void |
setCustomProfileNumber(String variableName,
double value)
Set or update the value associated with a custom number profile variable.
This new value will be used as part of this user's personalization profile, and will be used from this point forward for segmentation, targeting, and reporting purposes. This can be called from anywhere in your app after the appropriate register call in Application.onCreate() . |
void |
setCustomProfileNumber(String variableName,
float value)
Set or update the value associated with a custom number profile variable.
This new value will be used as part of this user's personalization profile, and will be used from this point forward for segmentation, targeting, and reporting purposes. This can be called from anywhere in your app after the appropriate register call in Application.onCreate() . |
void |
setCustomProfileNumber(String variableName,
int value)
Set or update the value associated with a custom number profile variable.
This new value will be used as part of this user's personalization profile, and will be used from this point forward for segmentation, targeting, and reporting purposes. This can be called from anywhere in your app after the appropriate register call in Application.onCreate() . |
void |
setCustomProfileStringValue(String variableName,
String value)
Set or update the value associated with a custom string profile variable.
This new value will be used as part of this user's personalization profile, and will be used from this point forward for segmentation, targeting, and reporting purposes. This can be called from anywhere in your app after the appropriate register call in Application.onCreate() . |
void |
setDebugMode(boolean debug)
Turns debug mode on or off, under tag "Tune".
|
void |
setDeeplinkListener(TuneDeeplinkListener listener) |
void |
setDeviceBrand(String deviceBrand)
Sets the device brand, or manufacturer
|
void |
setDeviceId(String deviceId)
Sets the device IMEI/MEID
|
void |
setDeviceModel(String deviceModel)
Sets the device model
|
void |
setEmailCollection(boolean collectEmail)
Enables or disables primary Gmail address collection
Requires GET_ACCOUNTS permission
|
void |
setExistingUser(boolean existing)
Sets whether app was previously installed prior to version with TUNE SDK
|
void |
setFacebookEventLogging(boolean logging,
Context context,
boolean limitEventAndDataUsage)
Whether to log TUNE events in the FB SDK as well
|
void |
setFacebookUserId(String userId)
Sets the user ID to associate with Facebook
|
void |
setGender(TuneGender gender)
Sets the user gender.
|
void |
setGoogleAdvertisingId(String adId,
boolean isLATEnabled)
Sets the Google Play Services Advertising ID
|
void |
setGoogleUserId(String userId)
Sets the user ID to associate with Google
|
void |
setInstallReferrer(String referrer)
Overrides the Google Play INSTALL_REFERRER received
|
void |
setIsPayingUser(boolean isPayingUser)
Sets whether the user is revenue-generating or not
|
void |
setLatitude(double latitude)
Sets the device latitude.
|
void |
setListener(TuneListener listener)
Register a TuneListener interface to receive server response callback
|
void |
setLocation(Location location)
Sets the device location
|
void |
setLocation(TuneLocation location)
Sets the device location
|
void |
setLongitude(double longitude)
Sets the device longitude.
|
void |
setMacAddress(String macAddress)
Sets the device MAC address.
|
void |
setOptedOutOfPush(boolean optedOutOfPush)
Specify whether the current user has opted out of push messaging.
This information is added to the personalization profile of the current user for segmentation, targeting, and reporting purposes. |
void |
setOsVersion(String osVersion)
Sets the device OS version
|
void |
setPackageName(String packageName)
Sets the app package name
|
void |
setPhoneNumber(String phoneNumber)
Sets the device phone number
|
void |
setPluginName(String pluginName)
Set the name of plugin used, if any
|
void |
setPreloadedApp(TunePreloadData preloadData)
Sets publisher information for device preloaded apps
|
void |
setPushNotificationBuilder(TuneNotificationBuilder builder)
Provide Tune with a notification builder to provide defaults for your app's notifications.
If you do not use setPushNotificationSenderId(String) this doesn't do anything. |
void |
setPushNotificationRegistrationId(String registrationId)
Provide Tune with your GCM registration id for this device.
By using this method you are implicitly enabling Tune Push Messaging. |
void |
setPushNotificationSenderId(String pushSenderId)
Provide Tune with your Push Sender ID.
|
void |
setReferralSources(Activity act)
Get referral sources from Activity
|
void |
setReferralUrl(String url)
Set referral url (deeplink)
|
void |
setShouldAutoCollectDeviceLocation(boolean autoCollect)
Whether to autocollect device location if location is enabled
|
void |
setTRUSTeId(String tpid)
Sets the TRUSTe ID, should generate via their SDK
|
void |
setTwitterUserId(String userId)
Sets the user ID to associate with Twitter
|
protected void |
setUrlRequester(UrlRequester urlRequester)
Helper function to check Google Play INSTALL_REFERRER for deeplink
|
void |
setUserEmail(String userEmail)
Sets the custom user email.
|
void |
setUserId(String userId)
Sets the custom user ID.
|
void |
setUserName(String userName)
Sets the custom user name.
|
void |
setValueForHookById(String hookId,
String value)
Sets the value of a Power Hook.
|
protected void |
updateLocation()
If location autocollect is enabled,
tries to get latest location from TuneLocationListener, triggering update if needed
|
protected BroadcastReceiver networkStateReceiver
protected Context mContext
protected ExecutorService pubQueue
protected TuneEventQueue eventQueue
protected TuneLocationListener locationListener
protected TuneParameters params
protected TuneTestRequest tuneRequest
protected boolean initialized
protected boolean isRegistered
protected boolean collectLocation
public static Tune getInstance()
public static Tune init(Context context, String advertiserId, String conversionKey)
context
- Application contextadvertiserId
- TUNE advertiser IDconversionKey
- TUNE conversion keypublic static Tune init(Context context, String advertiserId, String conversionKey, boolean turnOnTMA)
context
- Application contextadvertiserId
- TUNE advertiser IDconversionKey
- TUNE conversion keyturnOnTMA
- Whether to enable TMA or notpublic static Tune init(Context context, String advertiserId, String conversionKey, boolean turnOnTMA, TuneConfiguration configuration)
context
- Application contextadvertiserId
- TUNE advertiser IDconversionKey
- TUNE conversion keyturnOnTMA
- Whether to enable TMA or notconfiguration
- custom SDK configurationpublic static void clear()
protected void initAll(String advertiserId, String conversionKey)
advertiserId
- the TUNE advertiser ID for the appconversionKey
- the TUNE conversion key for the apppublic static boolean isOnline(Context context)
context
- the app context to check connectivity fromprotected void addEventToQueue(String link, String data, JSONObject postBody, boolean firstSession)
protected void dumpQueue()
public void measureSession()
public void measureEvent(String eventName)
eventName
- event name in TUNE systempublic void measureEvent(int eventId)
eventId
- event ID in TUNE systempublic void measureEvent(TuneEvent eventData)
new TuneEvent(eventName)
eventData
- custom data to associate with the eventprotected boolean makeRequest(String link, String data, JSONObject postBody)
protected void updateLocation()
public String getAction()
public String getAdvertiserId()
public int getAge()
public double getAltitude()
public String getAndroidId()
public boolean getAppAdTrackingEnabled()
public String getAppName()
public int getAppVersion()
public String getConnectionType()
public String getCountryCode()
public String getCurrencyCode()
public String getDeviceBrand()
public String getDeviceCarrier()
public String getDeviceId()
public String getDeviceModel()
public boolean getExistingUser()
public String getFacebookUserId()
public TuneGender getGender()
public String getGoogleAdvertisingId()
public boolean getGoogleAdTrackingLimited()
public String getGoogleUserId()
public long getInstallDate()
public String getInstallReferrer()
public boolean getIsPayingUser()
public String getLanguage()
public String getLastOpenLogId()
public double getLatitude()
public double getLongitude()
public String getMacAddress()
public String getMatId()
public String getMCC()
public String getMNC()
public String getOpenLogId()
public String getOsVersion()
public String getPackageName()
public String getPluginName()
public String getReferralSource()
public String getReferralUrl()
public String getRefId()
public Double getRevenue()
public String getScreenDensity()
public String getScreenHeight()
public String getScreenWidth()
public String getSDKVersion()
public String getTRUSTeId()
public String getTwitterUserId()
public String getUserAgent()
public String getUserEmail()
public String getUserId()
public String getUserName()
public void setAdvertiserId(String advertiserId)
advertiserId
- TUNE advertiser IDpublic void setAge(int age)
age
- User agepublic void setAltitude(double altitude)
altitude
- device altitudepublic void setAndroidId(String androidId)
androidId
- ANDROID_IDpublic void setAndroidIdMd5(String androidIdMd5)
androidIdMd5
- ANDROID_ID MD5 hashpublic void setAndroidIdSha1(String androidIdSha1)
androidIdSha1
- ANDROID_ID SHA-1 hashpublic void setAndroidIdSha256(String androidIdSha256)
androidIdSha256
- ANDROID_ID SHA-256 hashpublic void setAppAdTrackingEnabled(boolean adTrackingEnabled)
adTrackingEnabled
- true if user has opted out of ad tracking at the app-level, false if notpublic void setConversionKey(String conversionKey)
conversionKey
- TUNE conversion keypublic void setCurrencyCode(String currencyCode)
currencyCode
- the currency codepublic void setDeeplinkListener(TuneDeeplinkListener listener)
public void setDeviceBrand(String deviceBrand)
deviceBrand
- device brandpublic void setDeviceId(String deviceId)
deviceId
- device IMEI/MEIDpublic void setDeviceModel(String deviceModel)
deviceModel
- device modelpublic void setExistingUser(boolean existing)
existing
- true if this user already had the app installed prior to updating to TUNE versionpublic void setFacebookUserId(String userId)
userId
- public void setGender(TuneGender gender)
gender
- use TuneGender.MALE, TuneGender.FEMALEpublic void setGoogleAdvertisingId(String adId, boolean isLATEnabled)
adId
- Google Play advertising IDisLATEnabled
- whether user has requested to limit use of the Google ad IDpublic void setGoogleUserId(String userId)
userId
- public void setInstallReferrer(String referrer)
referrer
- Your custom referrer valuepublic void setIsPayingUser(boolean isPayingUser)
isPayingUser
- true if the user has produced revenue, false if notpublic void setLatitude(double latitude)
latitude
- the device latitudepublic void setLocation(Location location)
location
- the device locationpublic void setLocation(TuneLocation location)
location
- the device location as a TuneLocationpublic void setLongitude(double longitude)
longitude
- the device longitudepublic void setListener(TuneListener listener)
listener
- a TuneListener object that will be called when server request is completepublic void setMacAddress(String macAddress)
macAddress
- device MAC addresspublic void setOsVersion(String osVersion)
osVersion
- device OS versionpublic void setPackageName(String packageName)
packageName
- App package namepublic void setPhoneNumber(String phoneNumber)
phoneNumber
- Phone numberpublic void setPreloadedApp(TunePreloadData preloadData)
preloadData
- Preload app attribution datapublic void setReferralSources(Activity act)
act
- Activity to get referring package name and url scheme frompublic void setReferralUrl(String url)
url
- deeplink with which app was invokedpublic void setTRUSTeId(String tpid)
tpid
- TRUSTe IDpublic void setTwitterUserId(String userId)
userId
- public void setUserEmail(String userEmail)
userEmail
- the user emailpublic void setUserId(String userId)
userId
- the user idpublic void setUserName(String userName)
userName
- the usernamepublic void setPluginName(String pluginName)
pluginName
- public void setDebugMode(boolean debug)
debug
- whether to enable debug outputpublic boolean isInDebugMode()
public void setEmailCollection(boolean collectEmail)
collectEmail
- whether to collect device email addresspublic void setFacebookEventLogging(boolean logging, Context context, boolean limitEventAndDataUsage)
logging
- Whether to send TUNE events to FB as wellcontext
- Activity contextlimitEventAndDataUsage
- Whether user opted out of ads targetingpublic void setShouldAutoCollectDeviceLocation(boolean autoCollect)
autoCollect
- Autocollect device location, default is truepublic void registerPowerHook(String hookId, String friendlyName, String defaultValue)
Application.onCreate()
.hookId
- The name of the configuration setting to register. Name must be unique for this app and cannot be empty.friendlyName
- The name for this hook that will be displayed in TMC. This value cannot be empty.defaultValue
- The default value for this hook. This value will be used if no value is passed in from TMC for this app. This value cannot be nil.public String getValueForHookById(String hookId)
hookId
- The name of the Power Hook you wish to retrieve. Will return nil if the Power Hook has not been registered.public void setValueForHookById(String hookId, String value)
hookId
- The name of the Power Hook you wish to set the value for.value
- The new value you would like to test.public void onPowerHooksChanged(TuneCallback callback)
callback
- The block of code to be executed.public void registerDeepAction(String actionId, String friendlyName, Map<String,String> defaultData, TuneDeepActionCallback action)
actionId
- The name of the deep action to register. Name must be unique for this app and cannot be null or empty.friendlyName
- The friendly name for this action that will be displayed in TMC. This value cannot be null.defaultData
- The default values for this deep action. These values will be used if no value is passed in from TMC for this app. This cannot be null.action
- The code block that implements Runnable to execute when this Deep Action fires. This cannot be nullpublic Map<String,TunePowerHookExperimentDetails> getPowerHookExperimentDetails()
public Map<String,TuneInAppMessageExperimentDetails> getInAppMessageExperimentDetails()
public void onFirstPlaylistDownloaded(TuneCallback callback)
callback
- A TuneCallback object that is to be executed.public void onFirstPlaylistDownloaded(TuneCallback callback, long timeout)
callback
- A TuneCallback object that is to be executed.timeout
- The number of miliseconds to wait until executing the callback regardless
of Playlist download.public void setPushNotificationSenderId(String pushSenderId)
setPushNotificationRegistrationId(String)
pushSenderId
- Your Push Sender Id.public void setPushNotificationRegistrationId(String registrationId)
setPushNotificationSenderId(String)
registrationId
- The device token you want to use.public void setPushNotificationBuilder(TuneNotificationBuilder builder)
setPushNotificationSenderId(String)
this doesn't do anything.
Important: If you do not provide a small icon for your notifications via the builder we will default to using your app icon. This may look odd if your app is targeting API 21+ because the OS will take only the alpha of the icon and display that on a neutral background. If your app is set to target API 21+ we strongly recommend that you take advantage of the TuneNotificationBuilder
API.builder
- by providing an TuneNotificationBuilder
you can provide defaults for your app's notifications for Artisan Push Messages, like the small iconpublic void setOptedOutOfPush(boolean optedOutOfPush)
optedOutOfPush
- Whether the user opted out of push messaging.public String getDeviceToken()
public boolean didUserManuallyDisablePush()
public void checkForDeferredDeeplink(TuneDeeplinkListener listener)
listener
- listener for deeplink value or errorprotected void setUrlRequester(UrlRequester urlRequester)
timeout
- maximum timeout to wait for referrer in mspublic void registerCustomProfileString(String variableName)
setCustomProfileStringValue(String, String)
. The default value is nil. Application.onCreate()
method.variableName
- Name of the variable to register for the current user. Valid characters for this name include [0-9],[a-z],[A-Z], -, and _. Any other characters will automatically be stripped out.public void registerCustomProfileDate(String variableName)
setCustomProfileDate(String, Date)
. The default value is nil. Application.onCreate()
method.variableName
- Name of the variable to register for the current user. Valid characters for this name include [0-9],[a-z],[A-Z], -, and _. Any other characters will automatically be stripped out.public void registerCustomProfileNumber(String variableName)
setCustomProfileNumber(String, double)
, setCustomProfileNumber(String, float)
, or setCustomProfileNumber(String, int)
.
You may use these setters interchangeably. The default value is nil.
Application.onCreate()
method.variableName
- Name of the variable to register for the current user. Valid characters for this name include [0-9],[a-z],[A-Z], -, and _. Any other characters will automatically be stripped out.public void registerCustomProfileGeolocation(String variableName)
setCustomProfileGeolocation(String, TuneLocation)
. The default value is nil. Application.onCreate()
method.variableName
- Name of the variable to register for the current user. Valid characters for this name include [0-9],[a-z],[A-Z], -, and _. Any other characters will automatically be stripped out.public void registerCustomProfileString(String variableName, String defaultValue)
setCustomProfileStringValue(String, String)
. The default value is nil. Application.onCreate()
method.variableName
- Name of the variable to register for the current user. Valid characters for this name include [0-9],[a-z],[A-Z], -, and _. Any other characters will automatically be stripped out.defaultValue
- Initial value for the variable.public void registerCustomProfileDate(String variableName, Date defaultValue)
setCustomProfileDate(String, Date)
. The default value is nil. Application.onCreate()
method.variableName
- Name of the variable to register for the current user. Valid characters for this name include [0-9],[a-z],[A-Z], -, and _. Any other characters will automatically be stripped out.defaultValue
- Initial value for the variable.public void registerCustomProfileNumber(String variableName, int defaultValue)
setCustomProfileNumber(String, double)
, setCustomProfileNumber(String, float)
, or setCustomProfileNumber(String, int)
.
You may use these setters interchangeably. The default value is nil.
Application.onCreate()
method.variableName
- Name of the variable to register for the current user. Valid characters for this name include [0-9],[a-z],[A-Z], -, and _. Any other characters will automatically be stripped out.defaultValue
- Initial value for the variable.public void registerCustomProfileNumber(String variableName, double defaultValue)
setCustomProfileNumber(String, double)
, setCustomProfileNumber(String, float)
, or setCustomProfileNumber(String, int)
.
You may use these setters interchangeably. The default value is nil.
Application.onCreate()
method.variableName
- Name of the variable to register for the current user. Valid characters for this name include [0-9],[a-z],[A-Z], -, and _. Any other characters will automatically be stripped out.defaultValue
- Initial value for the variable.public void registerCustomProfileNumber(String variableName, float defaultValue)
setCustomProfileNumber(String, double)
, setCustomProfileNumber(String, float)
, or setCustomProfileNumber(String, int)
.
You may use these setters interchangeably. The default value is nil.
Application.onCreate()
method.variableName
- Name of the variable to register for the current user. Valid characters for this name include [0-9],[a-z],[A-Z], -, and _. Any other characters will automatically be stripped out.defaultValue
- Initial value for the variable.public void registerCustomProfileGeolocation(String variableName, TuneLocation defaultValue)
setCustomProfileGeolocation(String, TuneLocation)
. The default value is nil. Application.onCreate()
method.variableName
- Name of the variable to register for the current user. Valid characters for this name include [0-9],[a-z],[A-Z], -, and _. Any other characters will automatically be stripped out.defaultValue
- Initial value for the variable.public void setCustomProfileStringValue(String variableName, String value)
Application.onCreate()
. value
- Value to use for the given variable.variableName
- Variable to which this value should be assigned.public void setCustomProfileDate(String variableName, Date value)
Application.onCreate()
. value
- Value to use for the given variable.variableName
- Variable to which this value should be assigned.public void setCustomProfileNumber(String variableName, int value)
Application.onCreate()
. value
- Value to use for the given variable.variableName
- Variable to which this value should be assigned.public void setCustomProfileNumber(String variableName, double value)
Application.onCreate()
. value
- Value to use for the given variable.variableName
- Variable to which this value should be assigned.public void setCustomProfileNumber(String variableName, float value)
Application.onCreate()
. value
- Value to use for the given variable.variableName
- Variable to which this value should be assigned.public void setCustomProfileGeolocation(String variableName, TuneLocation value)
Application.onCreate()
. value
- Value to use for the given variable.variableName
- Variable to which this value should be assigned.public String getCustomProfileString(String variableName)
Application.onCreate()
.
variableName
- Name of the custom profile variable.public Date getCustomProfileDate(String variableName)
Application.onCreate()
.
variableName
- Name of the custom profile variable.public Number getCustomProfileNumber(String variableName)
Application.onCreate()
.
variableName
- Name of the custom profile variable.public TuneLocation getCustomProfileGeolocation(String variableName)
Application.onCreate()
.
variableName
- Name of the custom profile variable.public void clearCustomProfileVariable(String variableName)
Application.onCreate()
.
public void clearAllCustomProfileVariables()
Application.onCreate()
.