public class SessionClient
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SESSION_PAUSE_EVENT_TYPE
The eventType recorded for session pause events
|
static java.lang.String |
SESSION_RESUME_EVENT_TYPE
The eventType recorded for session resume events
|
static java.lang.String |
SESSION_START_EVENT_TYPE
The eventType recorded for session start events
|
static java.lang.String |
SESSION_STOP_EVENT_TYPE
The eventType recorded for session stop events
|
Constructor and Description |
---|
SessionClient(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext pinpointContext)
CONSTRUCTOR
|
Modifier and Type | Method and Description |
---|---|
void |
pauseSession()
Briefly pauses an application session.
|
void |
resumeSession()
Resumes an application session.
|
void |
startSession()
Start a session which records a
SESSION_START_EVENT_TYPE event and
saves that sessionId to the AnalyticsClient to be used for recording future
events. |
void |
stopSession()
Stops a session which records a
SESSION_STOP_EVENT_TYPE
event and flushes the events in localstorage for submission. |
java.lang.String |
toString()
Overridden toString method for testing
|
public static final java.lang.String SESSION_START_EVENT_TYPE
public static final java.lang.String SESSION_STOP_EVENT_TYPE
public static final java.lang.String SESSION_PAUSE_EVENT_TYPE
public static final java.lang.String SESSION_RESUME_EVENT_TYPE
public SessionClient(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext pinpointContext)
pinpointContext
- The PinpointContext
public void startSession()
SESSION_START_EVENT_TYPE
event and
saves that sessionId to the AnalyticsClient to be used for recording future
events. This triggers an update of the endpointProfile. It is recommended to
start the session when the application comes to the foreground.public void stopSession()
SESSION_STOP_EVENT_TYPE
event and flushes the events in localstorage for submission.
It is recommended to stop the session when the application
goes to the background.public void pauseSession()
SESSION_PAUSE_EVENT_TYPE
event.
It is recommended to call in an activity's onPause() method.public void resumeSession()
SESSION_RESUME_EVENT_TYPE
event.
It is recommended to call in an activity's onResume() method.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.