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
success or error.
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
success or error method 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`.
Description:
Steps to reproduce:
How it can be fixed:
successorerror.successorerrormethod relatively at the end of the callback.