Interface SinchClientBuilder


  • public interface SinchClientBuilder
    The SinchClientBuilder class builds a new SinchClient instance. To construct a SinchClient, the required configuration parameters are: - Application Key - Environment host - UserID It is optional to specify: - CLI (Calling-Line Identifier / Caller-ID) that will be used for calls terminated to PSTN (Publicly Switched Telephone Network). - hmsDeviceToken and hmsApplicationId if Huawei Push is to be used.
    • Method Detail

      • context

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

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

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

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

        SinchClientBuilder callerIdentifier​(java.lang.String callerIdentifier)
        Sets the caller identifier used when calling with PSTN.
        Parameters:
        callerIdentifier - Optional. Must not be null.
        Returns:
        The SinchClientBuilder instance.
      • enableVideoCalls

        SinchClientBuilder enableVideoCalls​(boolean enableVideoCalls)
        Disables initialization of video calls if they are not needed. In case of Audio calls only, setting this value to 'false' allows apk work w/o requesting CAMERA permissions.
        Parameters:
        enableVideoCalls - Optional. Default value is 'true'
        Returns:
        The SinchClientBuilder instance.
      • hmsDeviceToken

        SinchClientBuilder hmsDeviceToken​(java.lang.String deviceToken)
        Sets the HMS Device Token if the Huawei Push is to be used.
        Parameters:
        deviceToken - Must not be null.
        Returns:
        The SinchClientBuilder instance.
      • hmsApplicationId

        SinchClientBuilder hmsApplicationId​(java.lang.String applicationId)
        Sets the HMS Application Id if the Huawei Push is to be used.
        Parameters:
        applicationId - Must not be null.
        Returns:
        The SinchClientBuilder instance.
      • build

        SinchClient build()
                   throws java.lang.IllegalArgumentException,
                          java.io.IOException
        Creates the resulting SinchClient.
        Returns:
        A new SinchClient 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.