handleMethodCall method

Future handleMethodCall(
  1. MethodCall call
)

Handles method calls over the MethodChannel of this plugin. Note: Check the "federated" architecture for a new way of doing this: https://flutter.dev/go/federated-plugins

Implementation

Future<dynamic> handleMethodCall(MethodCall call) async {
  switch (call.method) {
    case 'init':
      initFpjs(call);
      return;
    case 'getVisitorId':
      return getVisitorId(
          linkedId: call.arguments['linkedId'],
          tags: getTags(call.arguments['tags']),
          timeoutMs: call.arguments['timeoutMs']);
    case 'getVisitorData':
      return getVisitorData(
          linkedId: call.arguments['linkedId'],
          tags: getTags(call.arguments['tags']),
          timeoutMs: call.arguments['timeoutMs']);
    default:
      throw PlatformException(
        code: 'Unimplemented',
        details:
            'fpjs_pro_plugin for web doesn\'t implement \'${call.method}\'',
      );
  }
}