BlueConicClientImpl

class BlueConicClientImpl(activityContext: Activity) : BlueConicClient

Implementation of the BlueConic client, handling the profile retrieval and storage. This may be from cache, persistent storage on the client or direct requests to the BlueConic server.

Constructors

Link copied to clipboard
constructor(activityContext: Activity)

Types

Link copied to clipboard

Interface for callbacks.

Link copied to clipboard
object Companion
Link copied to clipboard

Enum for event types.

Properties

Link copied to clipboard
open override val activity: Activity

Returns the current activity.

Link copied to clipboard

The consented objectives IDs of this profile in a list, e.g. {"tracking", "advertising"}. Passing a property that was already set with values will cause the old values to be removed.

Link copied to clipboard
open override var isEnabled: Boolean

Returns true when the BlueConicClient is enabled. You are able to enable/ disable the BlueConicClient.

Link copied to clipboard

The privacy legislation for this profile, e.g. "GDPR". Passing a property that was already set with values will cause the old values to be removed.

Link copied to clipboard
open override val profileId: String?

Returns the ID of the profile.

Link copied to clipboard
Link copied to clipboard

The refused objectives IDs of this profile in a list, e.g. {"tracking", "advertising"}. Passing a property that was already set with values will cause the old values to be removed.

Link copied to clipboard
open override var screenName: String

Returns the screen name. When the screen name is set with a call to createEvent in the Activity's onResume method it will return that screen name. Otherwise it will return the Activity's title. This method is typically used in Plugins.

Link copied to clipboard

Returns all segments for the profile. The segments are retrieved by each PAGEVIEW event.

Functions

Link copied to clipboard
open override fun addConsentedObjective(objectiveId: String)

Adds a single objective ID to the consented objectives for this profile. If there are already values for a property the new value will be added. Values for a property need to be unique; passing the same value multiple times will have no effect.

Link copied to clipboard
open override fun addProfileValue(property: String, value: String)

Adds a single property value to the profile. If there are already values for a property the new value will be added. Values for a property need to be unique; passing the same value multiple times will have no effect.

Link copied to clipboard
open override fun addProfileValues(property: String, values: Collection<String>)

Add property values to the profile. The values are passed as a map from the property identifier to the list of property values. If there are already values for a property the new values will be added. Values for a property need to be unique; passing the same values multiple times will have no effect.

Link copied to clipboard
open override fun addRefusedObjective(objectiveId: String)

Adds a single objective ID to the refused objectives for this profile. If there are already values for a property the new value will be added. Values for a property need to be unique; passing the same value multiple times will have no effect.

Link copied to clipboard

Clear profile id, based on hostname and domain group.

Link copied to clipboard
open override fun createEvent(eventType: String, properties: Map<String, String?>)
open override fun createEvent(eventType: String, properties: Map<String, String?>, context: Activity)
open override fun createEvent(eventType: String, properties: Map<String, String?>, context: Activity, callback: Runnable?)

Registers an event of the specified type with the given properties.

open override fun createEvent(eventType: String, properties: Map<String, String?>, callback: Runnable?)

Registers an event of the specified type with the given properties. For a "PAGEVIEW" event a screenName can be passed, so interactions can be restricted on the Where tab in BlueConic.

Link copied to clipboard
open override fun createEventWithData(eventType: String, properties: Map<String, Any?>)
open override fun createEventWithData(eventType: String, properties: Map<String, Any?>, callback: Runnable?)

Registers an event of the specified type with the given data. The data object can contain a nested structure to be sent over custom events and/or with Timeline context in order to register timeline events.

open override fun createEventWithData(eventType: String, properties: Map<String, Any?>, context: Activity)
open override fun createEventWithData(eventType: String, properties: Map<String, Any?>, context: Activity, callback: Runnable?)

Registers an event of the specified type with the given data. The data object can contain a nested structure to sent over custom events and/or with Timeline context in order to register timeline events.

Link copied to clipboard
open override fun createTimelineEvent(eventType: String, eventDate: Date, properties: Map<String, Any?>, callback: Runnable?)

Registers an event on the timeline of the profile with the given properties.

Link copied to clipboard
open override fun createTimelineEventById(eventId: String, eventType: String, eventDate: Date, properties: Map<String, Any?>, callback: Runnable?)

Registers an event on the timeline of the profile with the given properties.

Link copied to clipboard
open override fun destroyPlugins()

Triggers a call to onDestroy on every plugin that was retrieved at the last PAGEVIEW.

Link copied to clipboard
open override fun getProfileValue(property: String?): String?

Returns the first value for a profile property.

Link copied to clipboard
open override fun getProfileValues(property: String?): Collection<String>

Returns the values for a profile property.

Link copied to clipboard
open override fun getView(expression: String?): View?

Returns a view component based on the given identifier or null if no match is found.

Link copied to clipboard
open override fun hasSegment(segmentId: String?): Boolean

Returns whether a profile has a segment or not.

Link copied to clipboard
open override fun incrementProfileValue(property: String, value: String?)

Increments a single property value to the profile. If there are already values for a property the new value will be the sum of all values.

Link copied to clipboard

Refreshes profile properties from the server. When the retrieval failed, the onError() method is invoked on the callback object. When successful the onSuccess() method is invoked. Before loading the values from the server the client sends his changed values to the server.

Link copied to clipboard

Loads the profile property labels.

Link copied to clipboard
fun onConnectivityChanged(isConnected: Boolean)

Callback when the connectivity status is changed.

Link copied to clipboard
open override fun registerPluginClass(pluginClass: Class<out BlueConicClient.Plugin>)

Register a plugin class. This is optional. Can be used to mark and define which Plugin classes to use for BlueConic when a page view is registered.

open override fun registerPluginClass(pluginClass: Class<out BlueConicClient.Plugin>, className: String)

Register a plugin class with a specific name. This is optional. Can be used to mark and define which Plugin classes to use for BlueConic when a page view is registered.

Link copied to clipboard
fun setContext(activity: Activity)
Link copied to clipboard
open override fun setLocale(locale: String)

Sets the locale to get parameters for. By default, the default locale configured in BlueConic is used.

Link copied to clipboard
fun setPlatformInformation(platformName: String, platformVersion: String)

Sets the platform information. Only use this method when you want to use it in combination with a BlueConic plugin (ex.: React Native).

Link copied to clipboard
open override fun setProfileValue(property: String, value: String?)

Sets a value on the profile. Passing a property that was already set with values will cause for the old values to be removed.

Link copied to clipboard
open override fun setProfileValues(property: String, values: Collection<String>)

Sets values on the profile. Passing a property that was already set with values will cause for the old values to be removed.

Link copied to clipboard
open override fun updateProfile()

Updates the profile to sync over the data from the Mobile app to the BlueConic servers and also pulls in the data that has changed on the BlueConic side.

open override fun updateProfile(callback: Runnable?)

Update the profile to sync over the data from the Mobile app to the BlueConic servers and; also pull in the data that has changed on the BlueConic side.