identify static method

  1. @Deprecated('Use identifyContact instead')
Future<void> identify({
  1. required String userId,
  2. GleapUserProperty? userProperties,
  3. String? userHash,
})

identify

Updates a session's user data.

Params

gleapUserSession The updated user data.

Available Platforms

Android, iOS, Web

Implementation

@Deprecated('Use identifyContact instead')
static Future<void> identify({
  required String userId,
  GleapUserProperty? userProperties,
  String? userHash,
}) async {
  if (!kIsWeb && !io.Platform.isAndroid && !io.Platform.isIOS) {
    debugPrint(
      'identify is not available for current operating system',
    );
    return;
  }

  if (userProperties != null && userHash != null) {
    await _channel.invokeMethod(
      'identify',
      {
        'userId': userId,
        'userProperties': userProperties.toJson(),
        'userHash': userHash,
      },
    );
  } else if (userProperties != null) {
    await _channel.invokeMethod(
      'identify',
      {
        'userId': userId,
        'userProperties': userProperties.toJson(),
      },
    );
  } else {
    await _channel.invokeMethod('identify', {'userId': userId});
  }
}