handleMethodCall method

Future handleMethodCall(
  1. MethodCall call
)

Implementation

Future<dynamic> handleMethodCall(MethodCall call) async {
  switch (call.method) {
    case 'initialize':
      return initialize(token: call.arguments['token']);

    case 'identify':
    case 'identifyContact':
      return identify(
        userId: call.arguments['userId'],
        userProperties: call.arguments['userProperties'],
        userHash: call.arguments['userHash'],
      );

    case 'updateContact':
      return updateContact(userProperties: call.arguments['userProperties']);

    case 'clearIdentity':
      return clearIdentity();

    case 'attachCustomData':
      return attachCustomData(
        customData: call.arguments['customData'],
      );

    case 'preFillForm':
      return preFillForm(
        formData: call.arguments['formData'],
      );

    case 'setCustomData':
      return setCustomData(
        key: call.arguments['key'],
        value: call.arguments['value'],
      );

    case 'removeCustomDataForKey':
      return removeCustomData(key: call.arguments['key']);

    case 'clearCustomData':
      return clearCustomData();

    case 'trackEvent':
      return trackEvent(
        name: call.arguments['name'],
        data: call.arguments['data'],
      );

    case 'trackPage':
      return trackEvent(name: "pageView", data: <String, dynamic>{
        'page': call.arguments['pageName'],
      });

    case 'sendSilentCrashReport':
      return sendSilentCrashReport(
        description: call.arguments['description'],
        severity: call.arguments['severity'],
        excludeData: call.arguments['excludeData'],
      );
    case 'openWidget':
      return openWidget();

    case 'closeWidget':
      return closeWidget();

    case 'startFeedbackFlow':
      return startFeedbackFlow(
        action: call.arguments['action'],
        showBackButton: call.arguments['showBackButton'],
      );

    case 'startConversation':
      return startConversation();

    case 'setLanguage':
      return setLanguage(language: call.arguments['language']);

    case 'isOpened':
      return isOpened();

    case 'setFrameUrl':
      return setFrameUrl(url: call.arguments['url']);

    case 'setApiUrl':
      return setApiUrl(url: call.arguments['url']);

    case 'log':
      return log(
        message: call.arguments['message'],
        logLevel: call.arguments['logLevel'],
      );
    case 'disableConsoleLog':
      return disableConsoleLog();

    case 'attachNetworkLogs':
      return attachNetworkLogs(networkLogs: call.arguments['networkLogs']);

    case 'showFeedbackButton':
      return showFeedbackButton(visible: call.arguments['visible']);

    case 'openChecklists':
      return openChecklists(showBackButton: call.arguments['showBackButton']);

    case 'openChecklist':
      return openChecklist(
          checklistId: call.arguments['checklistId'],
          showBackButton: call.arguments['showBackButton']);

    case 'startChecklist':
      return startChecklist(
          outboundId: call.arguments['outboundId'],
          showBackButton: call.arguments['showBackButton']);

    case 'openNews':
      return openNews(showBackButton: call.arguments['showBackButton']);

    case 'openNewsArticle':
      return openNewsArticle(
          articleId: call.arguments['articleId'],
          showBackButton: call.arguments['showBackButton']);

    case 'openHelpCenter':
      return openHelpCenter(showBackButton: call.arguments['showBackButton']);

    case 'openHelpCenterArticle':
      return openHelpCenterArticle(
          articleId: call.arguments['articleId'],
          showBackButton: call.arguments['showBackButton']);

    case 'openHelpCenterCollection':
      return openHelpCenterCollection(
          collectionId: call.arguments['collectionId'],
          showBackButton: call.arguments['showBackButton']);

    case 'searchHelpCenter':
      return searchHelpCenter(
          term: call.arguments['term'],
          showBackButton: call.arguments['showBackButton']);

    case 'openFeatureRequests':
      return openFeatureRequests(
          showBackButton: call.arguments['showBackButton']);

    case 'isUserIdentified':
      return isUserIdentified();

    case 'getIdentity':
      return getIdentity();

    case 'showSurvey':
      return showSurvey(
        surveyId: call.arguments['surveyId'],
        format: call.arguments['format'],
      );

    case 'setTags':
      return setTags(tags: call.arguments['tags']);

    case 'setDisableInAppNotifications':
      return setDisableInAppNotifications(
        disable: call.arguments['disable'],
      );

    case 'setNetworkLogsBlacklist':
      return setNetworkLogsBlacklist(
        networkLogBlacklist: call.arguments['blacklist'],
      );

    case 'setNetworkLogPropsToIgnore':
      return setNetworkLogPropsToIgnore(
        filters: call.arguments['networkLogPropsToIgnore'],
      );

    case 'setAiTools':
      return setAiTools(tools: call.arguments['tools']);

    case 'setTicketAttribute':
      return setTicketAttribute(
        key: call.arguments['key'],
        value: call.arguments['value'],
      );

    case 'unsetTicketAttribute':
      return unsetTicketAttribute(key: call.arguments['key']);

    case 'clearTicketAttributes':
      return clearTicketAttributes();

    case 'startBot':
      return startBot(botId: call.arguments['botId']);

    case 'openConversation':
      return openConversation(shareToken: call.arguments['shareToken']);

    case 'openConversations':
      return openConversations();

    case 'startClassicForm':
      return startClassicForm(formId: call.arguments['formId']);

    default:
      throw PlatformException(
        code: 'Unimplemented',
        details: 'gleap_sdk for web doesn\'t implement \'${call.method}\'',
      );
  }
}