Object SDKInitializer

  • All Implemented Interfaces:

    
    public class SDKInitializer
    
                        

    Represents the utility to initialize MobileService used by the mobile app when starting the app. Usually start function should be called in 'onCreate' of your Application.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static Unit start(Application application, MobileService services, String apiKey, String pubKey) Starts the application with the services.
      final static Unit start(Application application, MobileService services, String apiKey) Starts the application with the services.
      final static Unit start(Application application, MobileService services) Starts the application with the services.
      final <T extends MobileService> T getService(KClass<T> clazz) Retrieves the enabled service by the given clazz, 'null' will be returned if no such a service is found.
      final Unit initializeService(MobileService service) Initializes a service after SDKInitializer is initialized.
      final Unit resetServices(Function1<MobileService, Boolean> resetHandler) Resets all services.
      final Unit notifyClientPoliciesRetrieved(ClientPolicies policy) Notifies the services about the new client policy retrieved from the server.
      final static List<MobileService> getServices() Retrieves the service list
      final Unit reset() Internal for testing
      final String getApiKey()
      final String getPubKey()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • start

        @JvmOverloads() final static Unit start(Application application, MobileService services, String apiKey, String pubKey)

        Starts the application with the services. The instance of each service will be notified with the application states at different occasions, then they can execute their logic according to the state.

      • start

        @JvmOverloads() final static Unit start(Application application, MobileService services, String apiKey)

        Starts the application with the services. The instance of each service will be notified with the application states at different occasions, then they can execute their logic according to the state.

      • start

        @JvmOverloads() final static Unit start(Application application, MobileService services)

        Starts the application with the services. The instance of each service will be notified with the application states at different occasions, then they can execute their logic according to the state.

      • getService

         final <T extends MobileService> T getService(KClass<T> clazz)

        Retrieves the enabled service by the given clazz, 'null' will be returned if no such a service is found.

      • initializeService

         final Unit initializeService(MobileService service)

        Initializes a service after SDKInitializer is initialized.

        Parameters:
        service - the service to start.
      • resetServices

         final Unit resetServices(Function1<MobileService, Boolean> resetHandler)

        Resets all services. resetHandler is where client code injects its own logic to reset a service. If either client code handles the reset of certain service, or wants to ignore the reset of it, the resetHandler can return 'true' for that service, otherwise, the default reset logic will be used.

      • reset

        @VisibleForTesting() final Unit reset()

        Internal for testing