Skip to main content

Installation

This guide will walk you through the steps to install the react-native-viewlytics package in your React Native project.

Step 1: Install the package

Install the package using npm or yarn.

npm install react-native-viewlytics

Step 2: Install Peer Dependencies

The following peer dependencies are required for the package to work properly:

npm install react-native-device-info
note

You might get warnings related to peer dependencies after installation. They are usually caused by incorrect version ranges specified in some packages. You can safely ignore these warnings as long as your app builds and works as expected.

Step 3: Run pod install

Run the following command to install the required CocoaPods dependencies:

npx pod-install

Step 4: (For Expo projects only) Rebuild native dependencies

Run prebuild to update the native code in the ios and android directories.

npx expo prebuild

Step 5: You're ready!

Congratulations! You have successfully installed Viewlytics in your React Native project.

Now you can start integrating the package into your application. Check the Usage Guide to learn how to start capturing screenshots.