collectNativeContext method

  1. @override
Future<AttriaxNativeContext> collectNativeContext({
  1. bool collectAdvertisingId = true,
})
override

Implementation

@override
Future<AttriaxNativeContext> collectNativeContext({
  bool collectAdvertisingId = true,
}) async {
  try {
    final result = await _channel.invokeMethod<Object?>(
      'collectNativeContext',
      <String, Object?>{'collectAdvertisingId': collectAdvertisingId},
    );
    return AttriaxNativeContext.fromPayload(result);
  } on MissingPluginException catch (error, stackTrace) {
    _logException('collectNativeContext', error, stackTrace);
    return const AttriaxNativeContext();
  } on PlatformException catch (error, stackTrace) {
    _logException('collectNativeContext', error, stackTrace);
    return const AttriaxNativeContext();
  }
}