Class Sdk


  • public final class Sdk
    extends java.lang.Object
    Contains all the basic api calls in the core kit
    • Constructor Detail

      • Sdk

        public Sdk​(android.app.Application application,
                   SdkConfig sdkConfig)
    • Method Detail

      • getInstance

        public static Sdk getInstance()
      • initialize

        public static void initialize​(android.app.Application application,
                                      SdkConfig sdkConfig)
        Initialize the SDK using the given Endpoint.
        Parameters:
        application - the current Android Application
        sdkConfig - the current SDK config
      • initialize

        public static void initialize​(android.app.Application application)
        Initialize the SDK
        Parameters:
        application - the current application Application
      • getContext

        public android.content.Context getContext()
        Get the application context
        Returns:
        Context Context
      • login

        public void login​(java.lang.String jwToken)
        Login via java web token
        Parameters:
        jwToken - third party java web token
      • isInitialized

        public static boolean isInitialized()
        Indicated whether the Android Core SDK is initialized.
        Returns:
        true if initialized, false if not
      • getAccessToken

        public java.lang.String getAccessToken()
        Get the currently stored Loyalty API Access Token
        Returns:
        access token which is currently stored in your Application instance
      • isThirdPartyAuth

        public boolean isThirdPartyAuth()
        Returns a boolean which indicates if the authentication was made by a third party authenticator.
        Returns:
        true if authentication is from third party false if authentication is from loyalty
      • getRefreshToken

        public java.lang.String getRefreshToken()
        Get the currently stored Loyalty API Refresh Token
        Returns:
        refresh token which is currently stored in your Application instance
      • getClientId

        public java.lang.String getClientId()
        Returns:
        client id which is currently stored in your Application instance
      • getClientUrl

        public java.lang.String getClientUrl()
        Returns:
        client url which is currently stored in your Application instance
      • getClientSecret

        public java.lang.String getClientSecret()
        Returns:
        client secret which is currently stored in your Application instance
      • isLoggedIn

        public boolean isLoggedIn()
        Check if a member is currently Logged in via SDK.
        Returns:
        true if current user is Logged in, false otherwise
      • shouldRequireResetPassword

        public boolean shouldRequireResetPassword()
        Flag for checking if the user should reset the password
        Returns:
        true if reset password is required, else false
      • setRequireResetPassword

        public void setRequireResetPassword​(boolean value)
        Set the flag that indicates whether user should reset password
        Parameters:
        value - true to enable reset password, else false
      • isSendLocationAnonymously

        public boolean isSendLocationAnonymously()
        Flag for checking if sending of location anonymously is allowed
        Returns:
        true if send location anonymously is enabled, else false
      • setSendLocationAnonymously

        public void setSendLocationAnonymously​(boolean isEnabled)
        Sets the flag that indicates whether sending of location anonymously is allowed
        Parameters:
        isEnabled - true - sending of location to server is allowed, false - sending of location to server is not allowed
      • isTokenExpired

        public boolean isTokenExpired()
        Check if the stored Loyalty API Access Token is already expired.
        Returns:
        true if expired, false if not
      • logout

        public void logout()
        Log out the current user. This method also removes the stored values (Access and Refresh Tokens, etc.) in your current Application.
      • refreshToken

        public void refreshToken()
        Refresh the currently stored Loyalty API Access Token. Usually done after checking if isTokenExpired().
      • trackAppUsage

        public void trackAppUsage()
        Track the users activity Once the app is launche the user will be tagged as active
      • getMemberId

        public java.lang.String getMemberId()
      • saveMemberId

        public void saveMemberId​(java.lang.String memberId)
      • clearMemberId

        public void clearMemberId()