Automatic screen_view notification

I am working on a project where screen_view is collected automatically on all views/screens.

Problem is in some cases especially since we’re using RxSwift, sometimes the screen_view will fire after some events on the new screen that we’re interested in have fired, so from an analytics point of view we end up having the wrong screen_view for the wrong events.

So my question is, is there a way to get notified whenever a new screen_view has fired? Maybe through notification center, Combine, or closures?

Thanks!

PS: Oh I almost forgot, I am talking about iOS in Swift.

Hi @trkslm ,

Would the tracker plugins help you in this case? They provide a way to subscribe to certain events and get a callback, see docs here. You could do something like:

let plugin = PluginConfiguration(identifier: "myPlugin")
plugin.afterTrack(
    schemas: ["iglu:com.snowplowanalytics.mobile/screen_view/jsonschema/1-0-0"]
) { event in
    // add your custom logic here
}
let tracker = Snowplow.createTracker(namespace: "namespace",
                                     network: networkConfig,
                                     configurations: [plugin])