startSurvey static method
Send to Screeb backend a tracking screen
name with optional properties
This api call is important to trigger a survey where the targeting is configured using screens parameters.
Implementation
static Future<bool?> startSurvey(
String surveyId, [
bool allowMultipleResponses = true,
Map<String, dynamic>? properties,
bool ignoreSurveyStatus = true,
Map<String, dynamic>? hooks,
]) {
Map<String, String>? mapHooksId;
if (hooks != null) {
mapHooksId = <String, String>{};
hooks.forEach((key, value) {
if (key == "version") {
mapHooksId![key] = value.toString();
} else {
// Random UUID
String uuid = UniqueKey().toString();
hooksRegistry[uuid] = value;
mapHooksId![key] = uuid;
}
});
}
return _channel.invokeMethod(
'startSurvey', [surveyId, allowMultipleResponses, _formatDates(properties), ignoreSurveyStatus, mapHooksId]);
}