Core (required)
These docs assume basic knowledge of React Native and Matrix jargon.
Steps
1. Add package
2. Add peer dependencies
3. Add postinstall script
Add the following line to the scripts
section of your package.json
:
This script adds a snippet of code to the package.json in the olm library, mapping "fs" to "react-native-level-fs".
4. Add or edit the metro.config.js file
At the root of your project, add or edit the metro.config.js file to include this:
5. Require globals and polyfill URL
Add these lines in your app before anything else:
6. Install Pods
Do this in the root directory, or if you prefer run cd ios && pod install && cd ..
in the root directory.
7. Run postinstall script
You only need to do this once - it's run automatically when you add or remove packages from now on.
8. Proguard (Android)
Add the following line in android/app/proguard-rules.pro
9. Initialize auth
In order to initialize the Matrix SDK to detect auth, you'll need to put this code snippet at the top level of your app, when it starts up, before your app but after the imports we got in step #5.
Last updated