@@ -16,7 +16,7 @@ This should be considered a primer before delving into the UI and Core Component
1616
1717Your [ environment should be setup] ( https://reactnative.dev/docs/environment-setup ) and a project created prior to beginning the installation.
1818
19- ### Add dependencies
19+ ### Add Required dependencies
2020
2121Install the required packages in your React Native project.
2222
@@ -60,6 +60,7 @@ Most if not all of the required packages now support auto-linking so setup shoul
6060- [ ` react-native-safe-area-context ` ] ( https://github.com/th3rdwave/react-native-safe-area-context )
6161- [ ` react-native-share ` ] ( https://github.com/react-native-share/react-native-share )
6262- [ ` react-native-svg ` ] ( https://github.com/react-native-svg/react-native-svg )
63+ - [ ` react-native-video ` ] ( https://github.com/react-native-video/react-native-video )
6364
6465<Tabs
6566 defaultValue = ' yarn'
@@ -71,14 +72,14 @@ Most if not all of the required packages now support auto-linking so setup shoul
7172<TabItem value = ' yarn' >
7273
7374``` bash
74- yarn add @react-native-community/cameraroll @react-native-community/netinfo @stream-io/flat-list-mvcp react-native-document-picker react-native-fs react-native-gesture-handler react-native-haptic-feedback react-native-haptic-feedback react-native-image-crop-picker react-native-image-resizer react-native-reanimated react-native-safe-area-context react-native-share react-native-svg
75+ yarn add @react-native-community/cameraroll @react-native-community/netinfo @stream-io/flat-list-mvcp react-native-document-picker react-native-fs react-native-gesture-handler react-native-haptic-feedback react-native-haptic-feedback react-native-image-crop-picker react-native-image-resizer react-native-reanimated react-native-safe-area-context react-native-share react-native-svg react-native-video
7576```
7677
7778</TabItem >
7879<TabItem value = ' npm' >
7980
8081``` bash
81- npm install @react-native-community/cameraroll @react-native-community/netinfo @stream-io/flat-list-mvcp react-native-document-picker react-native-fs react-native-gesture-handler react-native-haptic-feedback react-native-haptic-feedback react-native-image-crop-picker react-native-image-resizer react-native-reanimated react-native-safe-area-context react-native-share react-native-svg
82+ npm install @react-native-community/cameraroll @react-native-community/netinfo @stream-io/flat-list-mvcp react-native-document-picker react-native-fs react-native-gesture-handler react-native-haptic-feedback react-native-haptic-feedback react-native-image-crop-picker react-native-image-resizer react-native-reanimated react-native-safe-area-context react-native-share react-native-svg react-native-video
8283```
8384
8485</TabItem >
@@ -157,6 +158,15 @@ If you are planning to use file picker functionality, make sure you enable iClou
157158
158159:::
159160
161+ ### Add Optional Dependencies
162+
163+ - ` react-native-video ` - [ additional installation steps] ( https://github.com/react-native-video/react-native-video/blob/master/API.md#installation )
164+
165+ > Available in stream-chat-react-native >= v4.7.0
166+
167+ Installing this package allows you to play the video files/attachments in the chat. Otherwise by default, video files will be opened in default
168+ browser of the device.
169+
160170### AndroidX Support
161171
162172> AndroidX is a major step forward in the Android ecosystem, and the old support library artifacts are being deprecated.
@@ -170,9 +180,67 @@ But an awesome tool named [jetifier](https://github.com/mikehardy/jetifier) is q
170180
171181## Expo Installation
172182
173- Stream Chat for React Native is set up for parity on Expo, expo requires a different set of dependencies than bare React Native, in your project directory run:
183+ Stream Chat for React Native is set up for parity on Expo, expo requires a different set of dependencies than bare React Native, in your project directory run.
184+
185+ ### Add Required Dependencies
174186
175187```bash
176188expo install stream-chat-expo
177- expo install @react-native-community/netinfo expo-document-picker expo-file-system expo-haptics expo-image-manipulator expo-image-picker expo-media-library expo-sharing react-native-gesture-handler react-native-reanimated react-native-safe-area-context react-native-svg
189+ expo install @react-native-community/netinfo expo-document-picker expo-file-system expo-haptics expo-image-manipulator expo-image-picker expo-media-library expo-sharing react-native-gesture-handler react-native-reanimated react-native-safe-area-context react-native-svg expo-av
178190```
191+
192+ ### Additional Steps
193+
194+ For some of the packages listed below, there are additional steps required to setup the package:
195+
196+ - `react-native-reanimated` - [additional installation steps](https://docs.expo.dev/versions/latest/sdk/reanimated/#installation)
197+
198+ Add Reanimated's babel plugin to your babel.config.js:
199+
200+ ```js
201+ module.exports = {
202+ ...
203+ plugins : [
204+ ...
205+ ' react-native-reanimated/plugin' ,
206+ ],
207+ } ;
208+ ```
209+
210+ - `react-native-gesture-handler` - [additional installation steps](https://docs.expo.dev/versions/latest/sdk/gesture-handler/#api)
211+
212+ RNGH requires the package to be imported at the **top of the entry file** before anything else, this is usually your `App.js` or `index.js` file.
213+
214+ ```tsx
215+ import ' react-native-gesture-handler' ;
216+ import { AppRegistry } from ' react-native' ;
217+
218+ import App from ' ./App' ;
219+ import { name as appName } from ' ./app.json' ;
220+
221+ AppRegistry.registerComponent(appName, () => App);
222+ ```
223+
224+ Also wrap your entry point with `<GestureHandlerRootView>` or `gestureHandlerRootHO`
225+
226+ ```jsx
227+ import { GestureHandlerRootView } from ' react-native-gesture-handler' ;
228+ import { OverlayProvider } from ' stream-chat-react-native' ;
229+
230+ export default function App() {
231+ return (
232+ <GestureHandlerRootView >
233+ <OverlayProvider >{ /* Your app code goes here */ } </OverlayProvider >
234+ </GestureHandlerRootView >
235+ );
236+ }
237+ ```
238+
239+ ### Add Optional Dependencies
240+
241+ - `expo-av` - [additional installation steps](https://docs.expo.dev/versions/v45.0.0/sdk/video/)
242+
243+ > Available in stream-chat-expo >= v4.7.0
244+
245+ Installing this package allows you to play the video files/attachments in the chat. Otherwise by default, video files will be opened in default
246+ browser of the device.
0 commit comments