Package 

Class Session


  • 
    public abstract class Session
    
                        

    The Session class stores a User and all pending Record uploads.

    Overview

    The User and all pending Record data is persisted between app launches but is deleted if is called.

    Session is a singleton object and must be accessed by its getInstance method. The different components of the Validic Mobile library rely on a valid user existing in the current Session singleton object.

    A New session is started with a provided User. To use an existing user ID, create a create a User object and provide it to the startSessionWithUser method. Note, starting a session will delete all local data if a current session exists.

    Listeners

    When Session uploads a record it will notify the stored SessionListener. To receive these notifications, register a SessionListener by calling setSessionListener.

    If the record upload is successful, didSubmitRecord will be called.

    If a 400 error is returned from the server, the record will be discarded and didFailToSubmitRecord will be called.