handleMethodCall method
Implementation
Future<dynamic> handleMethodCall(MethodCall call) async {
switch (call.method) {
case 'initialize':
return initialize(token: call.arguments['token']);
case 'identify':
return identify(
userId: call.arguments['userId'],
userProperties: call.arguments['userProperties'],
userHash: call.arguments['userHash'],
);
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 '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'],
);
default:
throw PlatformException(
code: 'Unimplemented',
details: 'gleap_sdk for web doesn\'t implement \'${call.method}\'',
);
}
}