Just experimenting with Matrix on React Native
This tutorial provided by the React Native team is great. I followed the React Native CLI Quickstart section for Linux and Android.
git clone https://github.com/chaoticcapybara/rn-matrix-test-app.git
(or use SSH)yarn install
in the top dir of the repo- Create Matrix account
- The easiest way is to install Element and create an account on the matrix.org homeserver.
- Create UserInfo.json
- find your
baseUrl
,accessToken
anduserId
. On element:
Settings -> Help and About -> Advanced -> Home server for baseUrl Settings -> Help and About -> Advanced -> Reveal Access Token for the access token Settings -> General for the userId
- create UserInfo.js in the root of the repo with the following structure
export default UserInfo = { baseUrl: "https://example.homeserver.com", accessToken: "QRSD12312SFGS568JHZFD9", userId: "@myusername:example.homeserver.com" }
- find your
- In one terminal:
npx react-native start
- In another terminal:
npx react-native run-android
ornpx react-native run-ios
- Personally, I use my phone to test. In which case I do:
adb devices
to prompt my phone for developer permissions- Copy my phones ID from the
adb
output npx react-native run-android --deviceId=<copied device ID>
- Personally, I use my phone to test. In which case I do: