Package

## Interface UserController

- All Implemented Interfaces:

      public interface UserController

  A `UserController` manages registration of user and respective FCM and MHS push tokens for Sinch Managed Push functionality. Use `UserController` as a lightweight tool that allows to register user for incoming calls via Managed Push functionality without a necessity to start SinchClient. When PushTokenRegistrationCallback.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 the `UserController` is instantiated on.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `public class` | `UserController.Companion` |

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---

  - ### Enum Constant Summary

    Enum Constants
    Enum Constant | Description
    --- | ---

  - ### Method Summary

    Modifier and Type | Method | Description
    --- | --- | ---
    `abstract Unit` | `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.
    `abstract Unit` | `unregisterPushToken(PushTokenUnregistrationCallback pushTokenUnregistrationCallback)` | Unregisters any push token that has been registered for Sinch Managed Push (for the User that this instance is bound to).

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

  - ### Method Detail

    - #### registerUser

           abstract Unit 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.

      First UserRegistrationCallback callbacks are fired to either request needed credentials or to report success / failure of the registration.

      Then push token acquiring process is initiated. After token acquisition and registration PushTokenRegistrationCallback are fired to report success / failure.

      Parameters:
        `userRegistrationCallback` - callback for the user registration events.
        `pushTokenRegistrationCallback` - callback for push token registration events.

    - #### unregisterPushToken

           abstract Unit unregisterPushToken(PushTokenUnregistrationCallback pushTokenUnregistrationCallback)

      Unregisters any push token that has been registered for Sinch Managed Push (for the User that this instance is bound to).

      Parameters:
        `pushTokenUnregistrationCallback` - is a callback for push token unregistration events.