Screen events

User.com SDK provides an Observer that is able to track navigator push events. If the app uses default routing with navigator, just pass UserSdkNavigatorObserver() class inside MaterialApp.

  • return MaterialApp(
        navigatorObservers: [
          // Dont forget to name Routes in settings
          UserSdkNavigatorObserver(),
        ],
        home: const MyHomePage(),
      );
    

    If the app is using a custom routing ( like auto_route ), just create a new observer and trigger UserSdk.instance.screenEvent(‘routeName’) inside the method responsible for pushing a new route to the stack.

  • Manually screen tracking

    Note: If You don’t want to track all screens, just use UserSDK.instnce.screenEvent(‘screenName’); inside the class You want to track.

    UserComSDK.instance.sendScreenEvent(screenName: '/user_profile');