-
- All Implemented Interfaces:
-
com.permutive.android.PermutiveSdk,java.io.Closeable,java.lang.AutoCloseable
public interface PermutiveApi implements PermutiveSdk, Closeable
-
-
Method Summary
Modifier and Type Method Description abstract UnitsetIdentity(String identity, Integer priority, Date expiry)Associate an alias with the current user. abstract UnitsetIdentity(String identity)Associate an alias with the current user with lowest priority that never expires. abstract UnitsetIdentity(List<Alias> aliases)Associate an list of aliases with the current user. abstract EventTrackereventTracker()Create an EventTracker object. abstract TriggersProvidertriggersProvider()Create a TriggersProvider object. abstract UnitsetTitle(String title)Set the title context, used when tracking events. abstract UnitsetUrl(Uri url)Set the url context, used when tracking events. abstract UnitsetReferrer(Uri referrer)Set the referrer context, used when tracking events. abstract PageTrackertrackPage(EventProperties eventProperties, String title, Uri url, Uri referrer)Create a page tracker object with the given context & properties. abstract MediaTrackercreateVideoTracker(Long duration, EventProperties eventProperties, String title, Uri url, Uri referrer)Create a Media Tracker object for tracking user interaction with video content. abstract UnitsetDeveloperMode(Boolean enable)Enable/disable developer mode which will log more information to the console. abstract UnitclearPersistentData(Function0<Unit> onSuccess, Function1<Throwable, Unit> onFailure)Clear all persistent data of the current Permutive instance. abstract Result<Unit>clearPersistentData()Clear all persistent data of the current Permutive instance abstract SdkMetricsgetCurrentMetrics()Property containing basic metrics of the SDK -
Methods inherited from class com.permutive.android.PermutiveSdk
currentUserId, getCurrentActivations, getCurrentCohorts, getCurrentReactions, getCurrentSegments, logger, recordAppNexusAdImpression, recordAppNexusTargeting, recordGamTargeting, sessionId, trackApiCall, viewId, workspaceId -
Methods inherited from class java.io.Closeable
close -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
setIdentity
abstract Unit setIdentity(String identity, Integer priority, Date expiry)
Associate an alias with the current user. Forces segments and queries to be updated with the associated identity, if there is one on the server. Aliases will be deleted when their expiry is in the past.
- Parameters:
identity- An unique identifier of the user.priority- The priority of the alias, where 0 is the highest and Alias.LOWEST_PRIORITY is the lowest (Default: Alias.LOWEST_PRIORITY)expiry- The expiry time and date of the alias or Alias.NEVER_EXPIRE if it never expires (Default: Alias.NEVER_EXPIRE)
-
setIdentity
abstract Unit setIdentity(String identity)
Associate an alias with the current user with lowest priority that never expires. Forces segments and queries to be updated with the associated identity, if there is one on the server.
- Parameters:
identity- An unique identifier of the user.
-
setIdentity
abstract Unit setIdentity(List<Alias> aliases)
Associate an list of aliases with the current user. Aliases are resolved in the order given. Forces segments and queries to be updated with the associated identity, if there is one on the server.
- Parameters:
aliases- A list of aliases to use to identify the user.
-
eventTracker
@CheckResult() abstract EventTracker eventTracker()
Create an EventTracker object. Any number of these may be created.
-
triggersProvider
@CheckResult() abstract TriggersProvider triggersProvider()
Create a TriggersProvider object. Any number of these may be created.
-
setTitle
@Deprecated(message = "Please use the PageTracker api to track page title.") abstract Unit setTitle(String title)
Set the title context, used when tracking events.
-
setUrl
@Deprecated(message = "Please use the PageTracker api to track page url.") abstract Unit setUrl(Uri url)
Set the url context, used when tracking events.
-
setReferrer
@Deprecated(message = "Please use the PageTracker api to track page referrer.") abstract Unit setReferrer(Uri referrer)
Set the referrer context, used when tracking events.
-
trackPage
@CheckResult() abstract PageTracker trackPage(EventProperties eventProperties, String title, Uri url, Uri referrer)
Create a page tracker object with the given context & properties. A PageTracker object will automatically track a Pageview and PageviewComplete events upon creation and closing of the PageTracker object.
You should retain the PageTracker object until the page has finished viewing, and then call close once completed.
-
createVideoTracker
abstract MediaTracker createVideoTracker(Long duration, EventProperties eventProperties, String title, Uri url, Uri referrer)
Create a Media Tracker object for tracking user interaction with video content. A Videoview event will be tracked on creation of the MediaTracker.
- Parameters:
duration- The duration of the video in milliseconds.eventProperties- The event properties to be tracked with the initial Videoview event and the VideoCompletion event.title- The video title (default value null)url- The url of the video (default value null)referrer- The referring url of the video (default value null)
-
setDeveloperMode
abstract Unit setDeveloperMode(Boolean enable)
Enable/disable developer mode which will log more information to the console.
-
clearPersistentData
abstract Unit clearPersistentData(Function0<Unit> onSuccess, Function1<Throwable, Unit> onFailure)
Clear all persistent data of the current Permutive instance. Callbacks will run on the main thread.
- Parameters:
onSuccess- Callback which is called on successful deletiononFailure- Callback which is called when deletion fails
-
clearPersistentData
abstract Result<Unit> clearPersistentData()
Clear all persistent data of the current Permutive instance
-
getCurrentMetrics
abstract SdkMetrics getCurrentMetrics()
Property containing basic metrics of the SDK
-
-
-
-