public class CognitoDevice
extends java.lang.Object
CognitoUserAttributes
.Constructor and Description |
---|
CognitoDevice(com.amazonaws.services.cognitoidentityprovider.model.DeviceType device,
CognitoUser user,
android.content.Context context)
Constructs a
CognitoDevice object with DeviceType object. |
CognitoDevice(java.lang.String deviceKey,
CognitoUserAttributes deviceAttributes,
java.util.Date createDate,
java.util.Date lastModifiedDate,
java.util.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.
|
java.util.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.
|
java.lang.String |
getDeviceAttribute(java.lang.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.
|
java.lang.String |
getDeviceKey()
Returns the key of this device.
|
java.lang.String |
getDeviceName()
Returns the name of this device.
|
java.util.Date |
getLastAccessedDate()
The date when the device details were last read.
|
java.util.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(java.lang.String deviceKey, CognitoUserAttributes deviceAttributes, java.util.Date createDate, java.util.Date lastModifiedDate, java.util.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(com.amazonaws.services.cognitoidentityprovider.model.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 java.lang.String getDeviceKey()
public CognitoUserAttributes getDeviceAttributes()
CognitoUserAttributes
object.CognitoUserAttributes
object.public java.lang.String getDeviceAttribute(java.lang.String attributeName)
attributeName
- REQUIRED: The name of the attribute whose value is needed.public java.lang.String getDeviceName()
public java.util.Date getCreateDate()
public java.util.Date getLastModifiedDate()
public java.util.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 © 2018 Amazon Web Services, Inc. All Rights Reserved.