identify method

Future<void> identify(
  1. String distinctId, {
  2. String? email,
  3. String? name,
  4. String? phone,
  5. Map<String, Object?>? traits,
})

Identify the current end-user (shorthand for sessions.identify).

Implementation

Future<void> identify(
  String distinctId, {
  String? email,
  String? name,
  String? phone,
  Map<String, Object?>? traits,
}) async {
  await sessions.identify(
    distinctId,
    email: email,
    name: name,
    phone: phone,
    traits: traits,
  );
  // Voice binds its realtime room + push device at init (before login), so
  // re-bind to the newly-identified user — otherwise incoming calls would keep
  // ringing on the pre-login device room, never on `voice:<distinctId>`.
  if (config.voiceEnabled) await voice.rebindIdentity();
}