Package com.sinch.android.rtc
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
- HMS Device Token
- HMS Application id
- Callback Handler
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description UserControllerBuilder
applicationKey(java.lang.String applicationKey)
Sets the application key associated with the UserController.UserController
build()
Creates the resulting UserController.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.UserControllerBuilder
context(android.content.Context context)
Sets the context associated with the UserController.UserControllerBuilder
environmentHost(java.lang.String environmentHost)
Sets the environment host associated with the UserController.HmsPushBuilder
hms()
Create nested builder to specify configuration for Huawei Push Notifications using HMS (Huawei Mobile Services).UserControllerBuilder
userId(java.lang.String userId)
Sets the user id associated with the UserController.
-
-
-
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 databasejava.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.
-
-