handleMethodCall method

Future handleMethodCall(
  1. MethodCall call
)

Implementation

Future<dynamic> handleMethodCall(MethodCall call) async {
  switch (call.method) {
    case 'init':
      init(call);
      break;
    case 'connect':
      assertPusher();
      pusher!.connect();
      break;
    case 'disconnect':
      assertPusher();
      pusher!.disconnect();
      break;
    case 'subscribe':
      subscribe(call);
      break;
    case 'unsubscribe':
      unsubscribe(call);
      break;
    case 'trigger':
      trigger(call);
      break;
    case 'getSocketId':
      return pusher!.connection.socket_id;
    default:
      throw PlatformException(
        code: 'Unimplemented',
        details:
            'pusher_channels for web doesn\'t implement \'${call.method}\'',
      );
  }
}