Skip to content
New issue

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

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

Already on GitHub? # to your account

Await analytics initialization on client creation #131

Open
agalambas opened this issue Dec 10, 2024 · 0 comments
Open

Await analytics initialization on client creation #131

agalambas opened this issue Dec 10, 2024 · 0 comments

Comments

@agalambas
Copy link

agalambas commented Dec 10, 2024

/packages/core/lib/client.dart

+ Future<Analytics> createClient(Configuration configuration) async {
- Analytics createClient(Configuration configuration) {
    if (configuration.debug) {
      Analytics.debug = true;
    }
    if (configuration.flushPolicies == null) {
      configuration = setFlushPolicies(configuration, defaultFlushPolicies);
    }

    final analytics = Analytics(configuration, storeFactory());

    if (configuration.debug) {
      analytics.addPlugin(EventLogger());
    }

+.  await analytics.init();
-   analytics.init();
    ScreenObserver().screenStream.listen((name) {
      analytics.screen(name);
    });

    return analytics;
  }
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant