identify method

Future<IdentifyResult> identify(
  1. LDContext context
)

Changes the active context.

When the context is changed, the SDK will load flag values for the context from a local cache if available, while initiating a connection to retrieve the most current flag values. An event will be queued to be sent to the service containing the public LDContext fields for indexing on the dashboard.

This returned future can be awaited to wait for the identify process to be complete. As with start this can take an extended period if there is not network availability, so a timeout is recommended.

The identify will complete with 1 of three possible values: IdentifyComplete, IdentifySuperseded, or IdentifyError.

IdentifyComplete means that the SDK has managed to identify the user and either is using cached values or has received new values from LaunchDarkly.

IdentifySuperseded means that additional identify calls have been made and this specific call has been cancelled. If identify multiple contexts without waiting for the previous identify to complete, then you may get this result. For instance if you called identify 10 times rapidly, then it is likely that 2 total identifies would complete, the first one and the last one. The intermediates would be cancelled for performance.

IdentifyError this means that the identify has permanently failed. For instance the SDK key is no longer valid.

Implementation

Future<IdentifyResult> identify(LDContext context) async {
  return _client.identify(context);
}