Class RegistrationPresenter<T extends RegistrationView>
- java.lang.Object
- 
- com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter<V>
- 
- com.cheetahdigital.authentication.ui.login.LoginPresenter<T>
- 
- com.cheetahdigital.authentication.ui.registration.RegistrationPresenter<T>
 
 
 
- 
- All Implemented Interfaces:
- MvpPresenter<T>
 
 public class RegistrationPresenter<T extends RegistrationView> extends LoginPresenter<T> TheMvpPresenterclass forRegistrationActivityThis extends theLoginPresenterclass so as to inherit the other login methodsIt communicates to the Cheetah Loyalty API using the AuthenticationAPI. This communicates back the the API return to the view,RegistrationViewusing a default listener
- 
- 
Field Summary- 
Fields inherited from class com.cheetahdigital.authentication.ui.login.LoginPresenterAPPLE, ASSERTION_VALUE, FACEBOOK, GOOGLE, INSTAGRAM, MEMBER_ATTRIBUTE, PASSWORD_VALUE, TWITTER
 
- 
 - 
Constructor SummaryConstructors Constructor Description RegistrationPresenter()Default ConstructorRegistrationPresenter(AuthenticationFieldParams loginFieldParams)Create the presenter with givenAuthenticationFieldParamsmake sure that CLient ID and Client secret is set on the parameters
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AuthenticationAPIgetAuthenticationAPI()Get current instance ofAuthenticationAPIprotected Listener<SuccessResponse>getRegistrationListener(java.lang.String username, java.lang.String password, boolean isMobilePhoneEnabled)Create a listener forAuthenticationAPIprotected voidonRegistrationFailed(java.lang.String error)Called after a failed registration requestprotected voidonRegistrationSuccess(SuccessResponse data, java.lang.String username, java.lang.String password, boolean isMobilePhoneEnabled)Called after a success registration requestvoidsignup(AuthenticationFieldParams registrationFieldParams, boolean loginViaMobilePhone)Sign up a user with the following parameters- 
Methods inherited from class com.cheetahdigital.authentication.ui.login.LoginPresentergetInfo, getInfoAPI, getInfoReceivedListener, getLoginListener, login, logout, onInfoReceivedFailed, onInfoReceivedSuccess, onLoginFailed, onLoginSuccess
 - 
Methods inherited from class com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenterattachView, detachView, getView
 
- 
 
- 
- 
- 
Constructor Detail- 
RegistrationPresenterpublic RegistrationPresenter() Default Constructor
 - 
RegistrationPresenterpublic RegistrationPresenter(AuthenticationFieldParams loginFieldParams) Create the presenter with givenAuthenticationFieldParamsmake sure that CLient ID and Client secret is set on the parameters- Parameters:
- loginFieldParams- - login field parameters,must contain client id and client secret
 
 
- 
 - 
Method Detail- 
getRegistrationListenerprotected Listener<SuccessResponse> getRegistrationListener(java.lang.String username, java.lang.String password, boolean isMobilePhoneEnabled) Create a listener forAuthenticationAPI- Parameters:
- username- value for username
- password- value for password
- isMobilePhoneEnabled-- trueif mobile phone is enabled, else- false
- Returns:
- listener to handle AuthenticationAPIrequests
 
 - 
getAuthenticationAPIprotected AuthenticationAPI getAuthenticationAPI() Get current instance ofAuthenticationAPI- Overrides:
- getAuthenticationAPIin class- LoginPresenter<T extends RegistrationView>
- Returns:
- AuthenticationAPIused on this presenter
 
 - 
signuppublic void signup(AuthenticationFieldParams registrationFieldParams, boolean loginViaMobilePhone) Sign up a user with the following parameters- Parameters:
- registrationFieldParams- field parameters
- loginViaMobilePhone- true username is mobile phone, otherwise, false is username is email.
 
 - 
onRegistrationFailedprotected void onRegistrationFailed(java.lang.String error) Called after a failed registration request- Parameters:
- error- contains the details of the error
 
 - 
onRegistrationSuccessprotected void onRegistrationSuccess(SuccessResponse data, java.lang.String username, java.lang.String password, boolean isMobilePhoneEnabled) Called after a success registration request- Parameters:
- data- response in- SuccessResponseformat
- username- username used for the registration
- password- password used for the registration
- isMobilePhoneEnabled-- trueif mobile phone is enabled, else- false
 
 
- 
 
-