Interface UserControllerBuilder


  • public interface UserControllerBuilder

    The UserControllerBuilder class builds a new UserController instance. To construct a UserControllerBuilder, the required configuration parameters are:

    • Application Context (to be able to obtain FCM token)
    • Application Key
    • Environment host
    • UserID
    In case of HMS Push registration, use HMS sub-builder to specify:
    • HMS Device Token
    • HMS Application id
    It is optional to specify:
    • Callback Handler
    • Method Detail

      • context

        UserControllerBuilder context​(android.content.Context context)
        Sets the context associated with the UserController.
        Parameters:
        context - Must not be null.
        Returns:
        The UserControllerBuilder instance
      • userId

        UserControllerBuilder userId​(java.lang.String userId)
        Sets the user id associated with the UserController.
        Parameters:
        userId - Must not be null.
        Returns:
        The UserControllerBuilder instance.
      • applicationKey

        UserControllerBuilder applicationKey​(java.lang.String applicationKey)
        Sets the application key associated with the UserController.
        Parameters:
        applicationKey - Must not be null.
        Returns:
        The UserControllerBuilder instance.
      • environmentHost

        UserControllerBuilder environmentHost​(java.lang.String environmentHost)
        Sets the environment host associated with the UserController.
        Parameters:
        environmentHost - Must not be null.
        Returns:
        The UserControllerBuilder instance.
      • callbackHandler

        UserControllerBuilder callbackHandler​(com.sinch.android.rtc.internal.CallbackHandler callbackHandler)
        Sets the callback handler (on a thread with a looper) the UserController will post callbacks on.
        Parameters:
        callbackHandler - Must not be null.
        Returns:
        The UserControllerBuilder instance.
      • hms

        HmsPushBuilder hms()
        Create nested builder to specify configuration for Huawei Push Notifications using HMS (Huawei Mobile Services). This builder should be used to specify HMS push device token and Huawei Application ID.
        Returns:
        The HmsPushBuilder instance.
      • build

        UserController build()
                      throws java.lang.IllegalArgumentException,
                             java.io.IOException
        Creates the resulting UserController.
        Returns:
        A new UserController instance.
        Throws:
        java.io.IOException - if SinchClient fails to initialise local database
        java.lang.IllegalArgumentException - if context, userId, applicationKey, or environmentHost were not provided or were empty in the build steps, or if only one in the pair (HMS applicationId, HMS deviceToken) is null.