updateUser method

  1. @override
Future<void> updateUser({
  1. String? email,
  2. String? name,
  3. String? phone,
  4. String? company,
  5. String? companyId,
  6. String? userId,
  7. int? signedUpAt,
  8. String? language,
  9. Map<String, dynamic>? customAttributes,
  10. IntercomStatusCallback? statusCallback,
})
override

Updates the attributes of the current Intercom user.

The signedUpAt param should be seconds since epoch.

The language param should be an an ISO 639-1 two-letter code such as en for English or fr for French. You’ll need to use a four-letter code for Chinese like zh-CN. check this link https://www.intercom.com/help/en/articles/180-localize-intercom-to-work-with-multiple-languages.

See also:

Implementation

@override
Future<void> updateUser({
  String? email,
  String? name,
  String? phone,
  String? company,
  String? companyId,
  String? userId,
  int? signedUpAt,
  String? language,
  Map<String, dynamic>? customAttributes,
  IntercomStatusCallback? statusCallback,
}) async {
  try {
    await _channel.invokeMethod('updateUser', <String, dynamic>{
      'email': email,
      'name': name,
      'phone': phone,
      'company': company,
      'companyId': companyId,
      'userId': userId,
      'signedUpAt': signedUpAt,
      'language': language,
      'customAttributes': customAttributes,
    });
    statusCallback?.onSuccess?.call();
  } on PlatformException catch (e) {
    statusCallback?.onFailure?.call(_convertExceptionToIntercomError(e));
  }
}