Skip to content

Clevertap not return native display after completing the future of recordEvent but it worked when i wait for 3 seconds after the recordEvent and before getAllDisplayUnit() #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lalit3102 opened this issue Mar 3, 2022 · 2 comments
Assignees

Comments

@lalit3102
Copy link

static Future logEvent(String eventName, {Map<String, dynamic>? eventData}) async {
await CleverTapPlugin?.recordEvent(eventName, eventData ?? {});
}

not working
logEvent(CTEvents.researchTabOpened).then((value) async {
print("Success~~~~ ");
List? displayUnits = await CleverTapPlugin.getAllDisplayUnits();
print("Display Units = " + displayUnits.toString());
});`

Working
logEvent(CTEvents.researchTabOpened).then((value) async {
print("Success~~~~ ");
await Future.delayed(Duration(seconds: 3));
List? displayUnits = await CleverTapPlugin.getAllDisplayUnits();
print("Display Units = " + displayUnits.toString());
});

@william-ct
Copy link
Contributor

Hey @lalit3102 , Is there any reason why are you calling logEvent and CleverTapPlugin.getAllDisplayUnits() asynchronously? Can you try calling both the methods sequentially and check whether CleverTapPlugin.getAllDisplayUnits() is called without adding any delay?

@darshanclevertap
Copy link
Contributor

@lalit3102 Closing this due to inactivity. Please feel free to reopen this if you're still facing the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants