identify method

Future<void> identify({
  1. dynamic onIdentify(
    1. dynamic
    )?,
})

Identifies an activity and invokes the provided callback upon completion.

This method sets the onIdentify callback and then calls the identifyActivity method on the methodChannel. The callback is stored in the _callbacks map with the key "onIdentify".

The identifyCallBackId is set to 0 in the method channel invocation.

Parameters:

  • onIdentify: A callback function that takes a dynamic parameter. This function is called when the identification process is complete. If no callback is provided, a default function that does nothing is used.

Returns:

  • A Future<void> that completes when the identification process is done.

Implementation

Future<void> identify({
  Function(dynamic)? onIdentify,
}) async {
  registerCallback("onIdentify", onIdentify ?? (_) {});
  await methodChannel.invokeMethod('identifyActivity', {
    'identifyCallBackId': 0,
  });
}