public class CognitoDevice extends Object
CognitoUserAttributes.| Constructor and Description |
|---|
CognitoDevice(DeviceType device,
CognitoUser user,
android.content.Context context)
Constructs a
CognitoDevice object with DeviceType object. |
CognitoDevice(String deviceKey,
CognitoUserAttributes deviceAttributes,
Date createDate,
Date lastModifiedDate,
Date lastAccessedDate,
CognitoUser user,
android.content.Context context)
Constructs an object of type
CognitoDevice with device details. |
| Modifier and Type | Method and Description |
|---|---|
void |
doNotRememberThisDevice(GenericHandler callback)
Marks this device as not trusted, runs in the current thread.
|
void |
doNotRememberThisDeviceInBackground(GenericHandler callback)
Marks this device as not trusted, runs in a background thread.
|
void |
forgetDevice(GenericHandler callback)
Stops tracking this device, runs in the current thread.
|
void |
forgetDeviceInBackground(GenericHandler callback)
Stops tracking this device, runs in a background thread.
|
Date |
getCreateDate()
Returns the date this device was created in the Cognito User Pools, that is the date when the
service started tracking this device.
|
void |
getDevice(GenericHandler callback)
Fetches device properties, in the current thread.
|
String |
getDeviceAttribute(String attributeName)
Returns the value assigned for a specific attribute for this device.
|
CognitoUserAttributes |
getDeviceAttributes()
Returns all device attributes as an
CognitoUserAttributes object. |
void |
getDeviceInBackground(GenericHandler callback)
Fetches device properties.
|
String |
getDeviceKey()
Returns the key of this device.
|
String |
getDeviceName()
Returns the name of this device.
|
Date |
getLastAccessedDate()
The date when the device details were last read.
|
Date |
getLastModifiedDate()
Returns the date when attributes for this device were last modified.
|
void |
rememberThisDevice(GenericHandler callback)
Marks this device as trusted, runs in the current thread.
|
void |
rememberThisDeviceInBackground(GenericHandler callback)
Marks this device as trusted, runs in a background.
|
public CognitoDevice(String deviceKey, CognitoUserAttributes deviceAttributes, Date createDate, Date lastModifiedDate, Date lastAccessedDate, CognitoUser user, android.content.Context context)
CognitoDevice with device details.deviceKey - REQUIRED: The device key.deviceAttributes - REQUIRED: All devices attributes, stored as a CognitoUserAttributes object.createDate - REQUIRED: The date when the device tracking last began.lastModifiedDate - REQUIRED: The date on which the device attributes were last modified.lastAccessedDate - REQUIRED: The date this device details were last read.user - REQUIRED: The CognitoUser this device is linked to.context - REQUIRED: App context.public CognitoDevice(DeviceType device, CognitoUser user, android.content.Context context)
CognitoDevice object with DeviceType object.device - REQUIRED: A DeviceType object.user - REQUIRED: The CognitoUser this device is linked to.context - REQUIRED: App context.public String getDeviceKey()
public CognitoUserAttributes getDeviceAttributes()
CognitoUserAttributes object.CognitoUserAttributes object.public String getDeviceAttribute(String attributeName)
attributeName - REQUIRED: The name of the attribute whose value is needed.public String getDeviceName()
public Date getCreateDate()
public Date getLastModifiedDate()
public Date getLastAccessedDate()
public void getDeviceInBackground(GenericHandler callback)
callback - REQUIRED: GenericHandler callback.public void getDevice(GenericHandler callback)
Note: This method will perform network operations. Calling this method in applications' main thread will cause Android to throw NetworkOnMainThreadException.
callback - REQUIRED: GenericHandler callback.public void forgetDeviceInBackground(GenericHandler callback)
callback - REQUIRED: GenericHandler callback.public void forgetDevice(GenericHandler callback)
Note: This method will perform network operations. Calling this method in applications' main thread will cause Android to throw NetworkOnMainThreadException.
callback - REQUIRED: GenericHandler callback.public void rememberThisDeviceInBackground(GenericHandler callback)
callback - REQUIRED: GenericHandler callback.public void rememberThisDevice(GenericHandler callback)
Note: This method will perform network operations. Calling this method in applications' main thread will cause Android to throw NetworkOnMainThreadException.
callback - REQUIRED: GenericHandler callback.public void doNotRememberThisDeviceInBackground(GenericHandler callback)
callback - REQUIRED: GenericHandler callback.public void doNotRememberThisDevice(GenericHandler callback)
Note: This method will perform network operations. Calling this method in applications' main thread will cause Android to throw NetworkOnMainThreadException.
callback - REQUIRED: GenericHandler callback.Copyright © 2020. All rights reserved.