emotionAiCaptureCompleted method
Called when a score is successfully fetched from the server.
Implementation
@override
void emotionAiCaptureCompleted(score) {
Flagship.logger(Level.INFO,
"The delegate with score \($score ?? \"null\" has been called");
this.eaiVisitorScored = (score == null) ? false : true;
if (Flagship.sharedInstance().eaiActivationEnabled) {
this.emotionScoreAI = score;
// Update the context
if (score != null) {
this.updateContext("eai::eas", score);
}
} else {
Flagship.logger(Level.INFO,
"eaiActivationEnabled is false will not communicate the score value");
}
// save to cache
_visitorDelegate.getStrategy().cacheVisitor(
visitorId, jsonEncode(VisitorCache.fromVisitor(this).toJson()));
}