Class Stitch


  • public final class Stitch
    extends Object
    The entry point into the Android SDK. This class is responsible for allowing one to initialize StitchAppClients and work with Stitch.
    • Method Detail

      • initialize

        public static void initialize​(Context context)
        Initializes the Stitch SDK so that app clients can be created.
        Parameters:
        context - An Android context value.
      • getDefaultAppClient

        public static StitchAppClient getDefaultAppClient()
        Gets the default initialized app client. If one has not been set, then an error will be thrown. StitchInitProvider will normally automatically initialize the default app client using configured resource values but initializeDefaultAppClient(String) can also be used to initialize the default app client.
        Returns:
        The default initialized app client.
      • getAppClient

        public static StitchAppClient getAppClient​(@Nonnull
                                                   String clientAppId)
        Gets an app client by its client app id if it has been initialized; throws if none can be found.
        Parameters:
        clientAppId - the client app id of the app client to get.
        Returns:
        the app client associated with the client app id.
      • hasAppClient

        public static boolean hasAppClient​(String clientAppId)
        Checks if an app client has been initialized by its client app id.
        Parameters:
        clientAppId - the client app id to search for.
        Returns:
        if an app client has been initialized by its client app id.
      • initializeDefaultAppClient

        public static StitchAppClient initializeDefaultAppClient​(@Nonnull
                                                                 String clientAppId)
        Initializes the default app client for Stitch to use when using getDefaultAppClient(). Can only be called once.
        Parameters:
        clientAppId - the client app id to initialize an app client for.
        Returns:
        the app client that was just initialized.
      • initializeDefaultAppClient

        public static StitchAppClient initializeDefaultAppClient​(@Nonnull
                                                                 String clientAppId,
                                                                 @Nonnull
                                                                 StitchAppClientConfiguration config)
        Initializes the default app client for Stitch to use when using getDefaultAppClient(). Can only be called once.
        Parameters:
        clientAppId - the client app id to initialize an app client for.
        config - the configuration to use to build the app client.
        Returns:
        the app client that was just initialized.
      • initializeAppClient

        public static StitchAppClient initializeAppClient​(@Nonnull
                                                          String clientAppId)
        Initializes an app client for Stitch to use when using getAppClient(String)}. Can only be called once per client app id.
        Parameters:
        clientAppId - the client app id to initialize an app client for.
        Returns:
        the app client that was just initialized.
      • initializeAppClient

        public static StitchAppClient initializeAppClient​(@Nonnull
                                                          String clientAppId,
                                                          @Nonnull
                                                          StitchAppClientConfiguration config)
        Initializes an app client for Stitch to use when using getAppClient(String)}. Can only be called once per client app id.
        Parameters:
        clientAppId - the client app id to initialize an app client for.
        config - the configuration to use to build the app client.
        Returns:
        the app client that was just initialized.