public class BadgeRecoveryManager
extends java.lang.Object
implements android.arch.lifecycle.LifecycleObserver
BadgeRecoveryManager class collects all of the use cases related to badge recovery.
Badge recovery includes processes to request a badge recovery email and to recover your badge,
either through a badge invitation/recovery code or through a Deeplink URL. All of these methods
will be executed on a background thread and will return the result on the main thread. To receive
the result, you are expected to pass the corresponding SingleCallback or
CompleteCallback.
This class also includes login(BadgeLoginParam, SingleCallback), which takes a
BadgeLoginParam that is constructed from the user's credentials (i.e. user name/password)
and the organization ID, and returns a BadgeEntity object. This method is only valid for
environments that are set up with
active directory.
| Constructor and Description |
|---|
BadgeRecoveryManager(android.support.v7.app.AppCompatActivity appCompatActivity)
Constructor for an
BadgeRecoveryManager object with the lifecycle set. |
BadgeRecoveryManager(android.support.v4.app.Fragment fragment)
Constructor for an
BadgeRecoveryManager object with the lifecycle set. |
BadgeRecoveryManager(android.arch.lifecycle.Lifecycle lifecycle)
Constructor for an
BadgeRecoveryManager object with the lifecycle set. |
| Modifier and Type | Method and Description |
|---|---|
void |
login(BadgeLoginParam badgeLoginParam,
SingleCallback<BadgeEntity> callback)
Returns a
BadgeEntity object after logging into and refreshing a badge. |
void |
recover(java.lang.String code,
boolean badgeInvitation,
SingleCallback<java.util.List<BadgeEntity>> callback)
Returns a
List of BadgeEntity objects after using the badge recovery code or
badge invitation code to recover badges. |
void |
recover(java.lang.String deeplink,
SingleCallback<java.util.List<BadgeEntity>> callback)
Returns a
List of BadgeEntity objects after accessing a Deeplink URL to
recover badges. |
void |
request(java.lang.String emailAddress,
CompleteCallback callback)
Returns a
CompleteCallback after requesting a badge recovery email for the specified
email address. |
public BadgeRecoveryManager(android.arch.lifecycle.Lifecycle lifecycle)
BadgeRecoveryManager object with the lifecycle set.lifecycle - See Lifecyclepublic BadgeRecoveryManager(android.support.v7.app.AppCompatActivity appCompatActivity)
BadgeRecoveryManager object with the lifecycle set.appCompatActivity - See AppCompatActivitypublic BadgeRecoveryManager(android.support.v4.app.Fragment fragment)
BadgeRecoveryManager object with the lifecycle set.fragment - See Fragmentpublic void login(BadgeLoginParam badgeLoginParam, SingleCallback<BadgeEntity> callback)
BadgeEntity object after logging into and refreshing a badge.badgeLoginParam - the parameter for performing a badge login request. See
BadgeLoginParamcallback - the callback to receive the BadgeEntity object after logging
into and refreshing a badgepublic void recover(java.lang.String deeplink,
SingleCallback<java.util.List<BadgeEntity>> callback)
List of BadgeEntity objects after accessing a Deeplink URL to
recover badges.deeplink - the Deeplink URLcallback - the callback to receive the List of BadgeEntity objects after
accessing a Deeplink URL to recover badgespublic void recover(java.lang.String code,
boolean badgeInvitation,
SingleCallback<java.util.List<BadgeEntity>> callback)
List of BadgeEntity objects after using the badge recovery code or
badge invitation code to recover badges.code - the specific code to recover the badge.badgeInvitation - true if it is badge invitation code;
false otherwise (i.e. if it is badge recovery code)callback - the callback to receive the List of BadgeEntity
objects after using the badge recovery code or badge invitation code
to recover badgespublic void request(java.lang.String emailAddress,
CompleteCallback callback)
CompleteCallback after requesting a badge recovery email for the specified
email address.emailAddress - the email address to receive the badge recovery emailcallback - the callback to receive the result of requesting a badge recovery email