Class GetSocial


  • public final class GetSocial
    extends java.lang.Object
    Class contains main part of exposed GetSocial API.
    • Method Detail

      • getCurrentUser

        public static CurrentUser getCurrentUser()
        Current user.
        Returns:
        current user or null if SDK is not initialized.
      • switchUser

        public static void switchUser​(Identity identity,
                                      CompletionCallback callback,
                                      FailureCallback failure)
        Switches the current user with the User corresponding to the details provided.
        Parameters:
        identity - Identity to be switched to.
        callback - A callback to indicate if this operation was successful.
        failure - Called if operation failed.
      • resetUser

        public static void resetUser​(CompletionCallback callback,
                                     FailureCallback failure)
        Reset current user and create a new anonymous one.
        Parameters:
        callback - called if successfully reset user.
        failure - called if operation failed.
      • reset

        public static void reset​(CompletionCallback callback,
                                 FailureCallback failure)
        Reset the current user without creating a new anonymous one. The SDK is uninitialized.
        Parameters:
        callback - called if successfully reset the user.
        failure - called if operation failed.
      • getSdkVersion

        public static java.lang.String getSdkVersion()
        The version of GetSocial SDK.
        Returns:
        String value of the SDK version.
      • init

        public static void init()
        Init the SDK. Use addOnInitializeListener(Runnable) to be notified when SDK is initialized. GetSocial App Id will be taken from AndroidManifest.xml metadata.
      • init

        public static void init​(java.lang.String appId)
        Init the SDK. Use addOnInitializeListener(Runnable) to be notified when SDK is initialized.
        Parameters:
        appId - GetSocial App Id. You can find your App Id on the GetSocial Dashboard.
      • addOnInitializeListener

        public static void addOnInitializeListener​(java.lang.Runnable action)
        Set an action, which should be executed after SDK initialized. Executed immediately, if SDK is already initialized.
        Parameters:
        action - Action to execute.
      • isInitialized

        public static boolean isInitialized()
        Provides the status of the GetSocial initialisation.
        Returns:
        true if GetSocial initialization has completed successfully.
      • getLanguage

        public static java.lang.String getLanguage()
        Returns:
        current language of GetSocial SDK, return value is one of language codes provided in LanguageCodes, or default language in case of failure.
      • setLanguage

        public static boolean setLanguage​(java.lang.String languageCode)
        Set the language of GetSocial SDK. If language is incorrect, default language is set.
        Parameters:
        languageCode - Must be one of language codes provided in LanguageCodes
        Returns:
        true if the operation was successful, false otherwise
      • handle

        public static void handle​(Action action)
        Process action with default GetSocial behaviour.
        Parameters:
        action - action to be processed.