-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Description:
- The relative future provided by any plugin call is not getting completed.
Steps to reproduce:
Future<void> triggerCTAEvent() async {
await WebEngagePlugin.trackEvent('Added to Cart', {
"CTA": "add_to_cart",
});
log('Pushed CTA event to analytics');
}
triggerCTAEvent(); // It won't print the log-in console.
How it can be fixed:
- The plugin is not calling
successorerror.
private void setUserListAttribute(MethodCall call, Result result) {
String attributeName = call.argument(ATTRIBUTE_NAME);
List<? extends Object> attributes = call.argument(ATTRIBUTES);
WebEngage.get().user().setAttribute(attributeName, attributes);
}- After the call of WebEngage, call the
successorerrormethod relatively at the end of the callback. - example:
private void setUserListAttribute(MethodCall call, Result result) {
String attributeName = call.argument(ATTRIBUTE_NAME);
List<? extends Object> attributes = call.argument(ATTRIBUTES);
WebEngage.get().user().setAttribute(attributeName, attributes);
result.success(null); // <-- Add this line at the end of all call from the flutter or dart side
}- Now from the flutter side:
triggerCTAEvent(); // It will log this: `Pushed CTA event to analytics`. ibrahim-mubarak and Sagnik-Flutter
Metadata
Metadata
Assignees
Labels
No labels