Skip to main content

Track Screen Orientation

Add React Native Screen tracker​

Adding Context to Sessions​

Embrace can collect basic session data and crashes as you've already seen in the Crash Reporting and Session Reporting sections. Embrace can also collect when your app changes its orientation Here's how you add the Orientation tracker to the session.

Adding the component​

Embrace has a separate module to track Screen Orientation, to use it you will need to add the Screen Orientation Tracker

Install the component​

yarn add @embrace-io/react-native-orientation-change-tracker
npm install @embrace-io/react-native-orientation-change-tracker

Adding the method to your code​

Add the useEmbraceOrientationLogger to your component

// Import the Embrace log method
import { useEmbraceOrientationLogger } from "@embrace-io/react-native-orientation-change-tracker";

const App = () => {
useEmbraceOrientationLogger()
return (
...
);
};