Skip to content

The relative future provided by any plugin call is not getting completed. #35

@DK070202

Description

@DK070202

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`. 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions