register method

Future<OmiRegisterResult> register({
  1. required String userName,
  2. required String password,
  3. required String realm,
  4. required String fcmToken,
  5. String host = "",
  6. bool isVideo = true,
  7. String projectId = "",
})

Register a SIP extension with username / password.

host is the SIP proxy (host or host:port); leave it empty to use the OMICall default. fcmToken is the FCM token on Android and the APNS token on iOS.

Implementation

Future<OmiRegisterResult> register({
  required String userName,
  required String password,
  required String realm,
  required String fcmToken,
  String host = "",
  bool isVideo = true,
  String projectId = "",
}) async {
  final action = OmiAction(
    actionName: OmiActionName.INIT_CALL_USER_PASSWORD,
    data: {
      'userName': userName,
      'password': password,
      'realm': realm,
      'host': host,
      'isVideo': isVideo,
      'fcmToken': fcmToken,
      'projectId': projectId,
    },
  );
  return OmiRegisterResult.fromNative(await _controller.action(action));
}