heap / react-native-heap

A React Native integration for Heap
MIT License
82 stars 36 forks source link

Stop tracking native view controllers on iOS #296

Closed bnickel closed 2 years ago

bnickel commented 2 years ago

This change disables view controller capture on iOS unless enableNativeTouchEventCapture is set. This prevents a flood of meaningless RNSScreen pageviews that cause confusion during analysis.

I also updated Heap.setAppId to use the same initialization logic as auto-init.

To do this, Heap sets the new HeapOptions.disableViewControllerAutocapture option to YES on initialize. Each time Heap needs a new pageview (once per session) an empty one is added to the queue.

Test Plan

Changes were tested manually in a demo app and validated with detox.

Checklist

bnickel commented 2 years ago

@apyousef This is ready for re-review.