Package com.sinch.android.rtc
Interface UserController
-
public interface UserController
AUserController
manages registration of user and respective FCM and MHS push tokens for Sinch Managed Push functionality. UseUserController
as a lightweight tool that allows to register user for incoming calls via Managed Push functionality without a necessity to start SinchClient. WhenPushTokenRegistrationCallback.onPushTokenRegistered()
is called, you can be sure, that incoming calls will be received via FCM or HMS push notifications and you are free to close/terminate application if desired. Note: The callback will be invoked on the same thread as theUserController
is instantiated on.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
registerUser(UserRegistrationCallback userRegistrationCallback, PushTokenRegistrationCallback pushTokenRegistrationCallback)
Registers user and associated FCM or HMS Push Token for the Sinch Managed Push to allow receiving incoming calls via push for the specified user on this very device.void
unregisterPushToken(PushTokenRegistrationCallback pushTokenRegistrationCallback)
Unregisters any push token that has been registered for Sinch Managed Push (for the User that this instance is bound to).
-
-
-
Method Detail
-
registerUser
void registerUser(UserRegistrationCallback userRegistrationCallback, PushTokenRegistrationCallback pushTokenRegistrationCallback) throws java.lang.UnsupportedOperationException
Registers user and associated FCM or HMS Push Token for the Sinch Managed Push to allow receiving incoming calls via push for the specified user on this very device. Note: While Sinch SDK is managing a Sinch-specific FCM Sender ID and will acquire a token bound to this Sender ID, in case of HMS, both Huawei Application ID and Push Token should be provided viaHmsPushBuilder
. FirstUserRegistrationCallback
callbacks are fired to either request needed credentials or to report success / failure of the registration. Then in case of FCM, Token acquiring process is initiated. After token acquisition and registrationPushTokenRegistrationCallback
are fired to report success / failure.- Parameters:
userRegistrationCallback
- is a callback for the user registration events.pushTokenRegistrationCallback
- is a callback for push token registration events.- Throws:
java.lang.UnsupportedOperationException
- if Google Play Services is not available on the device.
-
unregisterPushToken
void unregisterPushToken(PushTokenRegistrationCallback pushTokenRegistrationCallback) throws java.lang.UnsupportedOperationException
Unregisters any push token that has been registered for Sinch Managed Push (for the User that this instance is bound to).- Parameters:
pushTokenRegistrationCallback
- is a callback for push token registration events.- Throws:
java.lang.UnsupportedOperationException
- if Google Play Services is not available on the device.
-
-