Class RegistrationPresenter<T extends RegistrationView>

    • Constructor Detail

      • RegistrationPresenter

        public RegistrationPresenter()
        Default Constructor
      • RegistrationPresenter

        public RegistrationPresenter​(AuthenticationFieldParams loginFieldParams)
        Create the presenter with given AuthenticationFieldParams make 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

      • getRegistrationListener

        protected Listener<SuccessResponse> getRegistrationListener​(java.lang.String username,
                                                                    java.lang.String password,
                                                                    boolean isMobilePhoneEnabled)
        Create a listener for AuthenticationAPI
        Parameters:
        username - value for username
        password - value for password
        isMobilePhoneEnabled - true if mobile phone is enabled, else false
        Returns:
        listener to handle AuthenticationAPI requests
      • signup

        public 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.
      • onRegistrationFailed

        protected void onRegistrationFailed​(java.lang.String error)
        Called after a failed registration request
        Parameters:
        error - contains the details of the error
      • onRegistrationSuccess

        protected void onRegistrationSuccess​(SuccessResponse data,
                                             java.lang.String username,
                                             java.lang.String password,
                                             boolean isMobilePhoneEnabled)
        Called after a success registration request
        Parameters:
        data - response in SuccessResponse format
        username - username used for the registration
        password - password used for the registration
        isMobilePhoneEnabled - true if mobile phone is enabled, else false