├── .nvmrc
├── .watchmanconfig
├── .eslintignore
├── example
├── .watchmanconfig
├── jest.config.js
├── .bundle
│ └── config
├── ios
│ ├── File.swift
│ ├── ReactNativeMatrixSdkExample
│ │ ├── Images.xcassets
│ │ │ ├── Contents.json
│ │ │ └── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ ├── AppDelegate.h
│ │ ├── main.m
│ │ ├── AppDelegate.mm
│ │ ├── PrivacyInfo.xcprivacy
│ │ ├── Info.plist
│ │ └── LaunchScreen.storyboard
│ ├── ReactNativeMatrixSdkExample-Bridging-Header.h
│ ├── ReactNativeMatrixSdkExample.xcworkspace
│ │ └── contents.xcworkspacedata
│ ├── .xcode.env
│ ├── ReactNativeMatrixSdkExampleTests
│ │ ├── Info.plist
│ │ └── ReactNativeMatrixSdkExampleTests.m
│ ├── Podfile
│ └── ReactNativeMatrixSdkExample.xcodeproj
│ │ └── xcshareddata
│ │ └── xcschemes
│ │ └── ReactNativeMatrixSdkExample.xcscheme
├── app.json
├── android
│ ├── app
│ │ ├── debug.keystore
│ │ ├── src
│ │ │ ├── main
│ │ │ │ ├── res
│ │ │ │ │ ├── values
│ │ │ │ │ │ ├── strings.xml
│ │ │ │ │ │ └── styles.xml
│ │ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ │ └── drawable
│ │ │ │ │ │ └── rn_edit_text_material.xml
│ │ │ │ ├── java
│ │ │ │ │ └── unomed
│ │ │ │ │ │ └── reactnativematrixsdk
│ │ │ │ │ │ └── example
│ │ │ │ │ │ ├── MainActivity.kt
│ │ │ │ │ │ └── MainApplication.kt
│ │ │ │ └── AndroidManifest.xml
│ │ │ └── debug
│ │ │ │ └── AndroidManifest.xml
│ │ ├── proguard-rules.pro
│ │ └── build.gradle
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── settings.gradle
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradlew.bat
│ └── gradlew
├── index.js
├── react-native.config.js
├── babel.config.js
├── Gemfile
├── metro.config.js
├── package.json
├── src
│ └── App.tsx
├── Gemfile.lock
└── README.md
├── .gitattributes
├── tsconfig.build.json
├── android
├── src
│ └── main
│ │ ├── AndroidManifestNew.xml
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── unomed
│ │ └── reactnativematrixsdk
│ │ ├── ReactNativeMatrixSdkPackage.kt
│ │ └── ReactNativeMatrixSdkModule.kt
├── proguard-rules.pro
├── gradle.properties
├── CMakeLists.txt
├── cpp-adapter.cpp
└── build.gradle
├── babel.config.js
├── .eslintrc
├── react-native.config.js
├── lefthook.yml
├── .editorconfig
├── .yarnrc.yml
├── .github
├── workflows
│ ├── install.yml
│ ├── library.yml
│ ├── lint.yml
│ ├── build-release.yml
│ ├── build-ios.yml
│ └── build-android.yml
└── actions
│ ├── setup-js
│ └── action.yml
│ └── generate
│ └── action.yml
├── src
├── NativeReactNativeMatrixSdk.ts
├── index.tsx
└── generated
│ ├── matrix_sdk_common.ts
│ ├── matrix_sdk_ui-ffi.ts
│ ├── matrix_sdk_base-ffi.ts
│ ├── matrix_sdk_common-ffi.ts
│ ├── matrix_sdk_crypto-ffi.ts
│ ├── matrix_sdk-ffi.ts
│ └── matrix_sdk_base.ts
├── ios
├── ReactNativeMatrixSdk.h
└── ReactNativeMatrixSdk.mm
├── cpp
├── unomed-react-native-matrix-sdk.h
├── unomed-react-native-matrix-sdk.cpp
└── generated
│ ├── matrix_sdk_ui.hpp
│ ├── matrix_sdk_base.hpp
│ ├── matrix_sdk_common.hpp
│ ├── matrix_sdk_crypto.hpp
│ └── matrix_sdk.hpp
├── patches
└── uniffi-bindgen-react-native+0.29.3-1.patch
├── tsconfig.json
├── ubrn.yaml
├── turbo.json
├── .gitignore
├── scripts
├── package-binaries.js
├── download-binaries.js
└── sort-uniffi-calls.js
├── ReactNativeMatrixSdk.podspec
├── README.md
├── CONTRIBUTING.md
├── package.json
└── matrix-rust-sdk.patch
/.nvmrc:
--------------------------------------------------------------------------------
1 | v18
2 |
--------------------------------------------------------------------------------
/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | src/
2 |
--------------------------------------------------------------------------------
/example/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/example/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | preset: 'react-native',
3 | };
4 |
--------------------------------------------------------------------------------
/example/.bundle/config:
--------------------------------------------------------------------------------
1 | BUNDLE_PATH: "vendor/bundle"
2 | BUNDLE_FORCE_RUBY_PLATFORM: 1
3 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.pbxproj -text
2 | # specific for windows script files
3 | *.bat text eol=crlf
4 |
--------------------------------------------------------------------------------
/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig",
3 | "exclude": ["example", "lib"]
4 | }
5 |
--------------------------------------------------------------------------------
/example/ios/File.swift:
--------------------------------------------------------------------------------
1 | //
2 | // File.swift
3 | // ReactNativeMatrixSdkExample
4 | //
5 |
6 | import Foundation
7 |
--------------------------------------------------------------------------------
/example/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ReactNativeMatrixSdkExample",
3 | "displayName": "ReactNativeMatrixSdkExample"
4 | }
5 |
--------------------------------------------------------------------------------
/android/src/main/AndroidManifestNew.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/example/android/app/debug.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/unomed-dev/react-native-matrix-sdk/HEAD/example/android/app/debug.keystore
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | ReactNativeMatrixSdkExample
3 |
4 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | ['module:react-native-builder-bob/babel-preset', { modules: 'commonjs' }],
4 | ],
5 | };
6 |
--------------------------------------------------------------------------------
/example/ios/ReactNativeMatrixSdkExample/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/unomed-dev/react-native-matrix-sdk/HEAD/example/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/example/ios/ReactNativeMatrixSdkExample-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | //
2 | // Use this file to import your target's public headers that you would like to expose to Swift.
3 | //
4 |
--------------------------------------------------------------------------------
/example/ios/ReactNativeMatrixSdkExample/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : RCTAppDelegate
5 |
6 | @end
7 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/unomed-dev/react-native-matrix-sdk/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/unomed-dev/react-native-matrix-sdk/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/unomed-dev/react-native-matrix-sdk/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Generated by uniffi-bindgen-react-native
2 | -dontwarn java.awt.*
3 | -keep class com.sun.jna.* { *; }
4 | -keepclassmembers class * extends com.sun.jna.* { public *; }
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/unomed-dev/react-native-matrix-sdk/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/unomed-dev/react-native-matrix-sdk/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/unomed-dev/react-native-matrix-sdk/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/unomed-dev/react-native-matrix-sdk/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/unomed-dev/react-native-matrix-sdk/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/unomed-dev/react-native-matrix-sdk/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/unomed-dev/react-native-matrix-sdk/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/index.js:
--------------------------------------------------------------------------------
1 | import { AppRegistry } from 'react-native';
2 | import App from './src/App';
3 | import { name as appName } from './app.json';
4 |
5 | AppRegistry.registerComponent(appName, () => App);
6 |
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "es6": true,
4 | "node": true
5 | },
6 | "parserOptions": {
7 | "ecmaVersion": 2018,
8 | "sourceType": "module"
9 | },
10 | "plugins": ["prettier"]
11 | }
12 |
--------------------------------------------------------------------------------
/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | ReactNativeMatrixSdk_kotlinVersion=1.7.0
2 | ReactNativeMatrixSdk_minSdkVersion=21
3 | ReactNativeMatrixSdk_targetSdkVersion=31
4 | ReactNativeMatrixSdk_compileSdkVersion=31
5 | ReactNativeMatrixSdk_ndkversion=21.4.7075529
6 |
--------------------------------------------------------------------------------
/example/ios/ReactNativeMatrixSdkExample/main.m:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char *argv[])
6 | {
7 | @autoreleasepool {
8 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/react-native.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @type {import('@react-native-community/cli-types').UserDependencyConfig}
3 | */
4 | module.exports = {
5 | dependency: {
6 | platforms: {
7 | android: {
8 | cmakeListsPath: 'generated/jni/CMakeLists.txt',
9 | },
10 | },
11 | },
12 | };
13 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/lefthook.yml:
--------------------------------------------------------------------------------
1 | pre-commit:
2 | parallel: true
3 | commands:
4 | lint:
5 | glob: "*.{js,ts,jsx,tsx}"
6 | run: npx eslint {staged_files}
7 | types:
8 | glob: "*.{js,ts, jsx, tsx}"
9 | run: npx tsc
10 | commit-msg:
11 | parallel: true
12 | commands:
13 | commitlint:
14 | run: npx commitlint --edit
15 |
--------------------------------------------------------------------------------
/example/react-native.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const pkg = require('../package.json');
3 |
4 | module.exports = {
5 | project: {
6 | ios: {
7 | automaticPodsInstallation: true,
8 | },
9 | },
10 | dependencies: {
11 | [pkg.name]: {
12 | root: path.join(__dirname, '..'),
13 | },
14 | },
15 | };
16 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig helps developers define and maintain consistent
2 | # coding styles between different editors and IDEs
3 | # editorconfig.org
4 |
5 | root = true
6 |
7 | [*]
8 |
9 | indent_style = space
10 | indent_size = 2
11 |
12 | end_of_line = lf
13 | charset = utf-8
14 | trim_trailing_whitespace = true
15 | insert_final_newline = true
16 |
--------------------------------------------------------------------------------
/example/ios/ReactNativeMatrixSdkExample.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.yarnrc.yml:
--------------------------------------------------------------------------------
1 | nodeLinker: node-modules
2 | nmHoistingLimits: workspaces
3 |
4 | plugins:
5 | - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
6 | spec: "@yarnpkg/plugin-interactive-tools"
7 | - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
8 | spec: "@yarnpkg/plugin-workspace-tools"
9 |
10 | yarnPath: .yarn/releases/yarn-3.6.1.cjs
11 |
--------------------------------------------------------------------------------
/example/babel.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const { getConfig } = require('react-native-builder-bob/babel-config');
3 | const pkg = require('../package.json');
4 |
5 | const root = path.resolve(__dirname, '..');
6 |
7 | module.exports = getConfig(
8 | {
9 | presets: ['module:@react-native/babel-preset'],
10 | },
11 | { root, pkg }
12 | );
13 |
--------------------------------------------------------------------------------
/.github/workflows/install.yml:
--------------------------------------------------------------------------------
1 | name: NPM install
2 | on:
3 | push:
4 | branches:
5 | - main
6 | workflow_dispatch:
7 |
8 | jobs:
9 | install:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: Install
13 | run: |
14 | mkdir my-app
15 | cd my-app
16 | npm init -y
17 | npm install @unomed/react-native-matrix-sdk
18 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
9 |
10 |
--------------------------------------------------------------------------------
/src/NativeReactNativeMatrixSdk.ts:
--------------------------------------------------------------------------------
1 | // Generated by uniffi-bindgen-react-native
2 | import type { TurboModule } from 'react-native';
3 | import { TurboModuleRegistry } from 'react-native';
4 |
5 | export interface Spec extends TurboModule {
6 | installRustCrate(): boolean;
7 | cleanupRustCrate(): boolean;
8 | }
9 |
10 | export default TurboModuleRegistry.getEnforcing('ReactNativeMatrixSdk');
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
2 | plugins { id("com.facebook.react.settings") }
3 | extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
4 | rootProject.name = 'unomed.reactnativematrixsdk.example'
5 | include ':app'
6 | includeBuild('../node_modules/@react-native/gradle-plugin')
7 |
--------------------------------------------------------------------------------
/example/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 |
3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4 | ruby ">= 2.6.10"
5 |
6 | # Exclude problematic versions of cocoapods and activesupport that causes build failures.
7 | gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8 | gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
9 | gem 'xcodeproj', '< 1.26.0'
10 | gem 'concurrent-ruby', '< 1.3.5'
11 |
--------------------------------------------------------------------------------
/ios/ReactNativeMatrixSdk.h:
--------------------------------------------------------------------------------
1 | // Generated by uniffi-bindgen-react-native
2 | #ifdef __cplusplus
3 | #import "unomed-react-native-matrix-sdk.h"
4 | #endif
5 |
6 | #ifdef RCT_NEW_ARCH_ENABLED
7 | #import "RNReactNativeMatrixSdkSpec.h"
8 |
9 | @interface ReactNativeMatrixSdk : NSObject
10 | #else
11 | #import
12 |
13 | @interface ReactNativeMatrixSdk : NSObject
14 | #endif
15 |
16 | @end
--------------------------------------------------------------------------------
/.github/workflows/library.yml:
--------------------------------------------------------------------------------
1 | name: Library
2 | on:
3 | push:
4 | branches:
5 | - main
6 | pull_request:
7 | branches:
8 | - main
9 | workflow_dispatch:
10 |
11 | jobs:
12 | build:
13 | runs-on: ubuntu-latest
14 | steps:
15 | - name: Checkout
16 | uses: actions/checkout@v4
17 |
18 | - name: Setup JS
19 | uses: ./.github/actions/setup-js
20 |
21 | - name: Build package
22 | run: yarn prepare
23 |
--------------------------------------------------------------------------------
/example/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
--------------------------------------------------------------------------------
/.github/workflows/lint.yml:
--------------------------------------------------------------------------------
1 | name: Lint
2 | on:
3 | push:
4 | branches:
5 | - main
6 | pull_request:
7 | branches:
8 | - main
9 | workflow_dispatch:
10 |
11 | jobs:
12 | lint:
13 | runs-on: ubuntu-latest
14 | steps:
15 | - name: Checkout
16 | uses: actions/checkout@v4
17 |
18 | - name: Setup JS
19 | uses: ./.github/actions/setup-js
20 |
21 | - name: Lint files
22 | run: yarn lint
23 |
24 | - name: Typecheck files
25 | run: yarn typecheck
26 |
--------------------------------------------------------------------------------
/example/ios/.xcode.env:
--------------------------------------------------------------------------------
1 | # This `.xcode.env` file is versioned and is used to source the environment
2 | # used when running script phases inside Xcode.
3 | # To customize your local environment, you can create an `.xcode.env.local`
4 | # file that is not versioned.
5 |
6 | # NODE_BINARY variable contains the PATH to the node executable.
7 | #
8 | # Customize the NODE_BINARY variable here.
9 | # For example, to use nvm with brew, add the following line
10 | # . "$(brew --prefix nvm)/nvm.sh" --no-use
11 | export NODE_BINARY=$(command -v node)
12 |
--------------------------------------------------------------------------------
/cpp/unomed-react-native-matrix-sdk.h:
--------------------------------------------------------------------------------
1 | #ifndef UNOMED_REACTNATIVEMATRIXSDK_H
2 | #define UNOMED_REACTNATIVEMATRIXSDK_H
3 | // Generated by uniffi-bindgen-react-native
4 | #include
5 | #include
6 | #include
7 |
8 | namespace unomed_reactnativematrixsdk {
9 | using namespace facebook;
10 |
11 | uint8_t installRustCrate(jsi::Runtime &runtime, std::shared_ptr callInvoker);
12 | uint8_t cleanupRustCrate(jsi::Runtime &runtime);
13 | }
14 |
15 | #endif /* UNOMED_REACTNATIVEMATRIXSDK_H */
--------------------------------------------------------------------------------
/example/metro.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const { getDefaultConfig } = require('@react-native/metro-config');
3 | const { getConfig } = require('react-native-builder-bob/metro-config');
4 | const pkg = require('../package.json');
5 |
6 | const root = path.resolve(__dirname, '..');
7 |
8 | /**
9 | * Metro configuration
10 | * https://facebook.github.io/metro/docs/configuration
11 | *
12 | * @type {import('metro-config').MetroConfig}
13 | */
14 | module.exports = getConfig(getDefaultConfig(__dirname), {
15 | root,
16 | pkg,
17 | project: __dirname,
18 | });
19 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | buildToolsVersion = "35.0.0"
4 | minSdkVersion = 24
5 | compileSdkVersion = 35
6 | targetSdkVersion = 34
7 | ndkVersion = "26.1.10909125"
8 | kotlinVersion = "1.9.25"
9 | }
10 | repositories {
11 | google()
12 | mavenCentral()
13 | }
14 | dependencies {
15 | classpath("com.android.tools.build:gradle")
16 | classpath("com.facebook.react:react-native-gradle-plugin")
17 | classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
18 | }
19 | }
20 |
21 | apply plugin: "com.facebook.react.rootproject"
22 |
--------------------------------------------------------------------------------
/patches/uniffi-bindgen-react-native+0.29.3-1.patch:
--------------------------------------------------------------------------------
1 | diff --git a/node_modules/uniffi-bindgen-react-native/crates/ubrn_cli/src/commands/generate.rs b/node_modules/uniffi-bindgen-react-native/crates/ubrn_cli/src/commands/generate.rs
2 | index 1b13ea1..a5113cc 100644
3 | --- a/node_modules/uniffi-bindgen-react-native/crates/ubrn_cli/src/commands/generate.rs
4 | +++ b/node_modules/uniffi-bindgen-react-native/crates/ubrn_cli/src/commands/generate.rs
5 | @@ -98,6 +98,7 @@ pub(crate) struct GenerateAllArgs {
6 | lib_file: Utf8PathBuf,
7 |
8 | /// Whether to generate native bindings or not.
9 | + #[clap(long, default_value = "false")]
10 | native_bindings: bool,
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/example/ios/ReactNativeMatrixSdkExampleTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/.github/actions/setup-js/action.yml:
--------------------------------------------------------------------------------
1 | name: Setup JS
2 | description: Set up Node.js and install dependencies
3 |
4 | runs:
5 | using: composite
6 | steps:
7 | - name: Setup Node.js
8 | uses: actions/setup-node@v4
9 | with:
10 | node-version-file: .nvmrc
11 |
12 | - name: Cache dependencies
13 | id: yarn-cache
14 | uses: actions/cache@v4
15 | with:
16 | path: |
17 | **/node_modules
18 | .yarn/install-state.gz
19 | key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
20 | restore-keys: |
21 | ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
22 | ${{ runner.os }}-yarn-
23 |
24 | - name: Install dependencies
25 | if: steps.yarn-cache.outputs.cache-hit != 'true'
26 | run: yarn install --immutable
27 | shell: bash
28 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "rootDir": ".",
4 | "paths": {
5 | "@unomed/react-native-matrix-sdk": ["./src/index"]
6 | },
7 | "allowUnreachableCode": false,
8 | "allowUnusedLabels": false,
9 | "esModuleInterop": true,
10 | "forceConsistentCasingInFileNames": true,
11 | "jsx": "react-jsx",
12 | "lib": ["ESNext"],
13 | "module": "ESNext",
14 | "moduleResolution": "Bundler",
15 | "noEmit": true,
16 | "noFallthroughCasesInSwitch": true,
17 | "noImplicitReturns": true,
18 | "noImplicitUseStrict": false,
19 | "noStrictGenericChecks": false,
20 | "noUncheckedIndexedAccess": true,
21 | "noUnusedLocals": false,
22 | "noUnusedParameters": false,
23 | "resolveJsonModule": true,
24 | "skipLibCheck": true,
25 | "strict": true,
26 | "target": "ESNext",
27 | "verbatimModuleSyntax": true
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/ubrn.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | crate:
3 | repo: https://github.com/matrix-org/matrix-rust-sdk
4 | rev: 5ef3ecac8c63d2373d8e45a47807769e602ebd89 # matrix-sdk-base-0.14.1
5 | manifestPath: bindings/matrix-sdk-ffi/Cargo.toml
6 | android:
7 | cargoExtras: ['--features', 'rustls-tls']
8 | directory: android
9 | native_bindings_dir: kotlin
10 | useSharedLibrary: true
11 | jniLibs: src/main/jniLibs
12 | targets:
13 | - arm64-v8a
14 | - armeabi-v7a
15 | ios:
16 | cargoExtras: ['--features', 'rustls-tls']
17 | directory: ios
18 | native_bindings_dir: swift
19 | targets:
20 | - aarch64-apple-ios
21 | - aarch64-apple-ios-sim
22 | - x86_64-apple-ios
23 | xcodebuildExtras: []
24 | frameworkName: build/RnMatrixRustSdk
25 | noOverwrite:
26 | - "android/build.gradle"
27 | turboModule:
28 | cpp: cpp
29 | ts: src
30 | bindings:
31 | cpp: cpp/generated
32 | ts: src/generated
33 |
--------------------------------------------------------------------------------
/turbo.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://turbo.build/schema.json",
3 | "pipeline": {
4 | "build:android": {
5 | "env": ["ORG_GRADLE_PROJECT_newArchEnabled"],
6 | "inputs": [
7 | "package.json",
8 | "android",
9 | "!android/build",
10 | "src/*.ts",
11 | "src/*.tsx",
12 | "example/package.json",
13 | "example/android",
14 | "!example/android/.gradle",
15 | "!example/android/build",
16 | "!example/android/app/build"
17 | ],
18 | "outputs": []
19 | },
20 | "build:ios": {
21 | "env": ["RCT_NEW_ARCH_ENABLED"],
22 | "inputs": [
23 | "package.json",
24 | "*.podspec",
25 | "ios",
26 | "src/*.ts",
27 | "src/*.tsx",
28 | "example/package.json",
29 | "example/ios",
30 | "!example/ios/build",
31 | "!example/ios/Pods"
32 | ],
33 | "outputs": []
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/example/ios/ReactNativeMatrixSdkExample/AppDelegate.mm:
--------------------------------------------------------------------------------
1 | #import "AppDelegate.h"
2 |
3 | #import
4 |
5 | @implementation AppDelegate
6 |
7 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
8 | {
9 | self.moduleName = @"ReactNativeMatrixSdkExample";
10 | // You can add your custom initial props in the dictionary below.
11 | // They will be passed down to the ViewController used by React Native.
12 | self.initialProps = @{};
13 |
14 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
15 | }
16 |
17 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
18 | {
19 | return [self bundleURL];
20 | }
21 |
22 | - (NSURL *)bundleURL
23 | {
24 | #if DEBUG
25 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
26 | #else
27 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
28 | #endif
29 | }
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/unomed/reactnativematrixsdk/example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package unomed.reactnativematrixsdk.example
2 |
3 | import com.facebook.react.ReactActivity
4 | import com.facebook.react.ReactActivityDelegate
5 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
6 | import com.facebook.react.defaults.DefaultReactActivityDelegate
7 |
8 | class MainActivity : ReactActivity() {
9 |
10 | /**
11 | * Returns the name of the main component registered from JavaScript. This is used to schedule
12 | * rendering of the component.
13 | */
14 | override fun getMainComponentName(): String = "ReactNativeMatrixSdkExample"
15 |
16 | /**
17 | * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
18 | * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
19 | */
20 | override fun createReactActivityDelegate(): ReactActivityDelegate =
21 | DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
22 | }
23 |
--------------------------------------------------------------------------------
/cpp/unomed-react-native-matrix-sdk.cpp:
--------------------------------------------------------------------------------
1 | // Generated by uniffi-bindgen-react-native
2 | #include "unomed-react-native-matrix-sdk.h"
3 | #include "generated/matrix_sdk.hpp"
4 | #include "generated/matrix_sdk_base.hpp"
5 | #include "generated/matrix_sdk_common.hpp"
6 | #include "generated/matrix_sdk_crypto.hpp"
7 | #include "generated/matrix_sdk_ffi.hpp"
8 | #include "generated/matrix_sdk_ui.hpp"
9 |
10 | namespace unomed_reactnativematrixsdk {
11 | using namespace facebook;
12 |
13 | uint8_t installRustCrate(jsi::Runtime &runtime, std::shared_ptr callInvoker) {
14 | NativeMatrixSdk::registerModule(runtime, callInvoker);
15 | NativeMatrixSdkBase::registerModule(runtime, callInvoker);
16 | NativeMatrixSdkCommon::registerModule(runtime, callInvoker);
17 | NativeMatrixSdkCrypto::registerModule(runtime, callInvoker);
18 | NativeMatrixSdkFfi::registerModule(runtime, callInvoker);
19 | NativeMatrixSdkUi::registerModule(runtime, callInvoker);
20 | return true;
21 | }
22 |
23 | uint8_t cleanupRustCrate(jsi::Runtime &runtime) {
24 | return false;
25 | }
26 | }
--------------------------------------------------------------------------------
/.github/workflows/build-release.yml:
--------------------------------------------------------------------------------
1 | name: Build (Release)
2 | on:
3 | workflow_dispatch:
4 |
5 | jobs:
6 | android:
7 | runs-on: ubuntu-latest
8 |
9 | steps:
10 | - name: Checkout
11 | uses: actions/checkout@v4
12 |
13 | - name: Generate
14 | uses: ./.github/actions/generate
15 | with:
16 | platform: android
17 | release: true
18 |
19 | - name: Upload artifact
20 | uses: actions/upload-artifact@v4
21 | with:
22 | name: android-libs
23 | path: android/**/*.so
24 | if-no-files-found: error
25 |
26 | ios:
27 | runs-on: macos-14
28 |
29 | steps:
30 | - name: Checkout
31 | uses: actions/checkout@v4
32 |
33 | - name: Generate
34 | uses: ./.github/actions/generate
35 | with:
36 | platform: ios
37 | release: true
38 |
39 | - name: Upload artifact
40 | uses: actions/upload-artifact@v4
41 | with:
42 | name: xcframework
43 | path: build/*.xcframework
44 | if-no-files-found: error
45 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
13 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/ios/ReactNativeMatrixSdkExample/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "scale" : "2x",
6 | "size" : "20x20"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "scale" : "3x",
11 | "size" : "20x20"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "scale" : "2x",
16 | "size" : "29x29"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "scale" : "3x",
21 | "size" : "29x29"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "scale" : "2x",
26 | "size" : "40x40"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "scale" : "3x",
31 | "size" : "40x40"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "scale" : "2x",
36 | "size" : "60x60"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "scale" : "3x",
41 | "size" : "60x60"
42 | },
43 | {
44 | "idiom" : "ios-marketing",
45 | "scale" : "1x",
46 | "size" : "1024x1024"
47 | }
48 | ],
49 | "info" : {
50 | "author" : "xcode",
51 | "version" : 1
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/example/ios/ReactNativeMatrixSdkExample/PrivacyInfo.xcprivacy:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | NSPrivacyAccessedAPITypes
6 |
7 |
8 | NSPrivacyAccessedAPIType
9 | NSPrivacyAccessedAPICategoryFileTimestamp
10 | NSPrivacyAccessedAPITypeReasons
11 |
12 | C617.1
13 |
14 |
15 |
16 | NSPrivacyAccessedAPIType
17 | NSPrivacyAccessedAPICategoryUserDefaults
18 | NSPrivacyAccessedAPITypeReasons
19 |
20 | CA92.1
21 |
22 |
23 |
24 | NSPrivacyAccessedAPIType
25 | NSPrivacyAccessedAPICategorySystemBootTime
26 | NSPrivacyAccessedAPITypeReasons
27 |
28 | 35F9.1
29 |
30 |
31 |
32 | NSPrivacyCollectedDataTypes
33 |
34 | NSPrivacyTracking
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | .DS_Store
3 |
4 | # XDE
5 | .expo/
6 |
7 | # VSCode
8 | .vscode/
9 | jsconfig.json
10 |
11 | # Xcode
12 | build/
13 | *.pbxuser
14 | !default.pbxuser
15 | *.mode1v3
16 | !default.mode1v3
17 | *.mode2v3
18 | !default.mode2v3
19 | *.perspectivev3
20 | !default.perspectivev3
21 | xcuserdata
22 | *.xccheckout
23 | *.moved-aside
24 | DerivedData
25 | *.hmap
26 | *.ipa
27 | *.xcuserstate
28 | project.xcworkspace
29 | .xcode.env.local
30 |
31 | # Android/IJ
32 | .classpath
33 | .cxx
34 | .gradle
35 | .idea
36 | .project
37 | .settings
38 | local.properties
39 | android.iml
40 | *.aar
41 |
42 | # Cocoapods
43 | example/ios/Pods
44 |
45 | # Ruby
46 | example/vendor/
47 |
48 | # node.js
49 | node_modules/
50 | npm-debug.log
51 | yarn-debug.log
52 | yarn-error.log
53 |
54 | # BUCK
55 | buck-out/
56 | \.buckd/
57 | android/app/libs
58 | android/keystores/debug.keystore
59 |
60 | # Yarn
61 | .yarn/*
62 | !.yarn/patches
63 | !.yarn/plugins
64 | !.yarn/releases
65 | !.yarn/sdks
66 | !.yarn/versions
67 |
68 | # Expo
69 | .expo/
70 |
71 | # Turborepo
72 | .turbo/
73 |
74 | # generated by bob
75 | lib/
76 |
77 | # uniffi-bindgen-react-native
78 | rust_modules/
79 | *.a
80 | *.so
81 |
82 | # React Native Codegen
83 | ios/generated
84 | android/generated
85 | binaries.tar.gz
86 |
--------------------------------------------------------------------------------
/android/src/main/java/com/unomed/reactnativematrixsdk/ReactNativeMatrixSdkPackage.kt:
--------------------------------------------------------------------------------
1 | // Generated by uniffi-bindgen-react-native
2 | package com.unomed.reactnativematrixsdk
3 |
4 | import com.facebook.react.TurboReactPackage
5 | import com.facebook.react.bridge.NativeModule
6 | import com.facebook.react.bridge.ReactApplicationContext
7 | import com.facebook.react.module.model.ReactModuleInfo
8 | import com.facebook.react.module.model.ReactModuleInfoProvider
9 | import java.util.HashMap
10 |
11 | class ReactNativeMatrixSdkPackage : TurboReactPackage() {
12 | override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
13 | return if (name == ReactNativeMatrixSdkModule.NAME) {
14 | ReactNativeMatrixSdkModule(reactContext)
15 | } else {
16 | null
17 | }
18 | }
19 |
20 | override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
21 | return ReactModuleInfoProvider {
22 | val moduleInfos: MutableMap = HashMap()
23 | moduleInfos[ReactNativeMatrixSdkModule.NAME] = ReactModuleInfo(
24 | ReactNativeMatrixSdkModule.NAME,
25 | ReactNativeMatrixSdkModule.NAME,
26 | false, // canOverrideExistingModule
27 | false, // needsEagerInit
28 | false, // isCxxModule
29 | true // isTurboModule
30 | )
31 | moduleInfos
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/example/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@unomed/react-native-matrix-sdk-example",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "android": "react-native run-android",
7 | "ios": "react-native run-ios",
8 | "start": "react-native start",
9 | "build:android": "react-native build-android --extra-params \"--no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a\"",
10 | "build:ios": "react-native build-ios --scheme ReactNativeMatrixSdkExample --mode Debug --extra-params \"-sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO\""
11 | },
12 | "dependencies": {
13 | "react": "18.3.1",
14 | "react-native": "0.76.9"
15 | },
16 | "devDependencies": {
17 | "@babel/core": "^7.25.2",
18 | "@babel/preset-env": "^7.25.3",
19 | "@babel/runtime": "^7.25.0",
20 | "@react-native-community/cli": "15.0.1",
21 | "@react-native-community/cli-platform-android": "15.0.1",
22 | "@react-native-community/cli-platform-ios": "15.0.1",
23 | "@react-native/babel-preset": "0.76.9",
24 | "@react-native/metro-config": "0.76.9",
25 | "@react-native/typescript-config": "0.76.9",
26 | "react-native-builder-bob": "^0.31.0"
27 | },
28 | "engines": {
29 | "node": ">=18"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/scripts/package-binaries.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | const fs = require('fs');
4 | const path = require('path');
5 | const tar = require('tar');
6 |
7 | async function packageBinaries() {
8 | const projectDir = path.join(__dirname, '..');
9 | const buildDir = path.join(projectDir, 'build');
10 | const androidLibsDir = path.join(projectDir, 'android', 'src', 'main', 'jniLibs');
11 | const outputFile = path.join(projectDir, 'binaries.tar.gz');
12 |
13 | if (!fs.existsSync(path.join(buildDir, 'RnMatrixRustSdk.xcframework'))) {
14 | console.error('No iOS binaries found in build directory. Run yarn generate:release first.');
15 | process.exit(1);
16 | }
17 |
18 | if (!fs.existsSync(androidLibsDir)) {
19 | console.error('No Android binaries found in android/src/main/jniLibs directory. Run yarn generate:release first.');
20 | process.exit(1);
21 | }
22 |
23 | console.log('Packaging binaries...');
24 |
25 | await tar.c({
26 | gzip: true,
27 | file: outputFile,
28 | cwd: projectDir,
29 | }, [
30 | 'build',
31 | 'android/src/main/jniLibs'
32 | ]);
33 |
34 | const stats = fs.statSync(outputFile);
35 | const sizeMB = (stats.size / 1024 / 1024).toFixed(2);
36 |
37 | console.log(`Binaries packaged successfully: ${outputFile} (${sizeMB} MB)`);
38 | }
39 |
40 | if (require.main === module) {
41 | packageBinaries().catch(console.error);
42 | }
43 |
44 | module.exports = { packageBinaries };
--------------------------------------------------------------------------------
/example/src/App.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | import { StyleSheet, View, Text, TextInput, Button } from 'react-native';
4 | import { ClientBuilder } from '@unomed/react-native-matrix-sdk';
5 |
6 | export default function App() {
7 | const [homeserver, setHomeserver] = React.useState("https://matrix.org");
8 | const [status, setStatus] = React.useState("");
9 |
10 | const updateHomeserverLoginDetails = React.useCallback(async () => {
11 | if (!homeserver.length) {
12 | setStatus("");
13 | return;
14 | }
15 |
16 | try {
17 | const client = await (new ClientBuilder()).homeserverUrl(homeserver).build();
18 | const loginDetails = await client.homeserverLoginDetails();
19 |
20 | setStatus(`url: ${loginDetails.url()}\n`
21 | + `supportsOidcLogin: ${loginDetails.supportsOidcLogin()}\n`
22 | + `supportsPasswordLogin: ${loginDetails.supportsPasswordLogin()}`);
23 | } catch (error) {
24 | setStatus(`${error}`);
25 | }
26 | }, [homeserver]);
27 |
28 | return (
29 |
30 |
31 |
32 | {status}
33 |
34 | );
35 | }
36 |
37 | const styles = StyleSheet.create({
38 | container: {
39 | flex: 1,
40 | alignItems: 'center',
41 | justifyContent: 'center',
42 | }
43 | });
44 |
--------------------------------------------------------------------------------
/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | ENV['RCT_NEW_ARCH_ENABLED'] = '1'
2 |
3 | # Resolve react_native_pods.rb with node to allow for hoisting
4 | require Pod::Executable.execute_command('node', ['-p',
5 | 'require.resolve(
6 | "react-native/scripts/react_native_pods.rb",
7 | {paths: [process.argv[1]]},
8 | )', __dir__]).strip
9 |
10 | platform :ios, min_ios_version_supported
11 | prepare_react_native_project!
12 |
13 | linkage = ENV['USE_FRAMEWORKS']
14 | if linkage != nil
15 | Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
16 | use_frameworks! :linkage => linkage.to_sym
17 | end
18 |
19 | target 'ReactNativeMatrixSdkExample' do
20 | config = use_native_modules!
21 |
22 | use_react_native!(
23 | :path => config[:reactNativePath],
24 | # An absolute path to your application root.
25 | :app_path => "#{Pod::Config.instance.installation_root}/.."
26 | )
27 |
28 | target 'ReactNativeMatrixSdkExampleTests' do
29 | inherit! :complete
30 | # Pods for testing
31 | end
32 |
33 |
34 | pre_install do |installer|
35 | system("cd ../../ && npx bob build --target codegen")
36 | end
37 |
38 | post_install do |installer|
39 | # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
40 | react_native_post_install(
41 | installer,
42 | config[:reactNativePath],
43 | :mac_catalyst_enabled => false,
44 | # :ccache_enabled => true
45 | )
46 | end
47 | end
48 |
--------------------------------------------------------------------------------
/android/src/main/java/com/unomed/reactnativematrixsdk/ReactNativeMatrixSdkModule.kt:
--------------------------------------------------------------------------------
1 | // Generated by uniffi-bindgen-react-native
2 | package com.unomed.reactnativematrixsdk
3 |
4 | import com.facebook.react.bridge.ReactApplicationContext
5 | import com.facebook.react.module.annotations.ReactModule
6 | import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder
7 |
8 | @ReactModule(name = ReactNativeMatrixSdkModule.NAME)
9 | class ReactNativeMatrixSdkModule(reactContext: ReactApplicationContext) :
10 | NativeReactNativeMatrixSdkSpec(reactContext) {
11 |
12 | override fun getName(): String {
13 | return NAME
14 | }
15 |
16 | // Two native methods implemented in cpp-adapter.cpp, and ultimately
17 | // unomed-react-native-matrix-sdk.cpp
18 |
19 | external fun nativeInstallRustCrate(runtimePointer: Long, callInvoker: CallInvokerHolder): Boolean
20 | external fun nativeCleanupRustCrate(runtimePointer: Long): Boolean
21 |
22 | override fun installRustCrate(): Boolean {
23 | val context = this.reactApplicationContext
24 | return nativeInstallRustCrate(
25 | context.javaScriptContextHolder!!.get(),
26 | context.jsCallInvokerHolder!!
27 | )
28 | }
29 |
30 | override fun cleanupRustCrate(): Boolean {
31 | return nativeCleanupRustCrate(
32 | this.reactApplicationContext.javaScriptContextHolder!!.get()
33 | )
34 | }
35 |
36 | companion object {
37 | const val NAME = "ReactNativeMatrixSdk"
38 |
39 | init {
40 | System.loadLibrary("unomed-react-native-matrix-sdk")
41 | }
42 | }
43 | }
--------------------------------------------------------------------------------
/example/ios/ReactNativeMatrixSdkExample/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ReactNativeMatrixSdkExample
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(MARKETING_VERSION)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(CURRENT_PROJECT_VERSION)
25 | LSRequiresIPhoneOS
26 |
27 | NSAppTransportSecurity
28 |
29 |
30 | NSAllowsArbitraryLoads
31 |
32 | NSAllowsLocalNetworking
33 |
34 |
35 | NSLocationWhenInUseUsageDescription
36 |
37 | UILaunchStoryboardName
38 | LaunchScreen
39 | UIRequiredDeviceCapabilities
40 |
41 | arm64
42 |
43 | UISupportedInterfaceOrientations
44 |
45 | UIInterfaceOrientationPortrait
46 | UIInterfaceOrientationLandscapeLeft
47 | UIInterfaceOrientationLandscapeRight
48 |
49 | UIViewControllerBasedStatusBarAppearance
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | # AndroidX package structure to make it clearer which packages are bundled with the
21 | # Android operating system, and which are packaged with your app's APK
22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
23 | android.useAndroidX=true
24 |
25 | # Use this property to specify which architecture you want to build.
26 | # You can also override it from the CLI using
27 | # ./gradlew -PreactNativeArchitectures=x86_64
28 | reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
29 |
30 | # Use this property to enable support to the new architecture.
31 | # This will allow you to use TurboModules and the Fabric render in
32 | # your application. You should enable this flag either if you want
33 | # to write custom TurboModules/Fabric components OR use libraries that
34 | # are providing them.
35 | newArchEnabled=true
36 |
37 | # Use this property to enable or disable the Hermes JS engine.
38 | # If set to false, you will be using JSC instead.
39 | hermesEnabled=true
40 |
41 | newArchEnabled=true
--------------------------------------------------------------------------------
/example/android/app/src/main/java/unomed/reactnativematrixsdk/example/MainApplication.kt:
--------------------------------------------------------------------------------
1 | package unomed.reactnativematrixsdk.example
2 |
3 | import android.app.Application
4 | import com.facebook.react.PackageList
5 | import com.facebook.react.ReactApplication
6 | import com.facebook.react.ReactHost
7 | import com.facebook.react.ReactNativeHost
8 | import com.facebook.react.ReactPackage
9 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
10 | import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
11 | import com.facebook.react.defaults.DefaultReactNativeHost
12 | import com.facebook.react.soloader.OpenSourceMergedSoMapping
13 | import com.facebook.soloader.SoLoader
14 |
15 | class MainApplication : Application(), ReactApplication {
16 |
17 | override val reactNativeHost: ReactNativeHost =
18 | object : DefaultReactNativeHost(this) {
19 | override fun getPackages(): List =
20 | PackageList(this).packages.apply {
21 | // Packages that cannot be autolinked yet can be added manually here, for example:
22 | // add(MyReactNativePackage())
23 | }
24 |
25 | override fun getJSMainModuleName(): String = "index"
26 |
27 | override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
28 |
29 | override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
30 | override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
31 | }
32 |
33 | override val reactHost: ReactHost
34 | get() = getDefaultReactHost(applicationContext, reactNativeHost)
35 |
36 | override fun onCreate() {
37 | super.onCreate()
38 | SoLoader.init(this, OpenSourceMergedSoMapping)
39 | if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
40 | // If you opted-in for the New Architecture, we load the native entry point for this app.
41 | load()
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/rn_edit_text_material.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
22 |
23 |
24 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/ReactNativeMatrixSdk.podspec:
--------------------------------------------------------------------------------
1 | # Generated by uniffi-bindgen-react-native
2 | require "json"
3 |
4 | package = JSON.parse(File.read(File.join(__dir__, "package.json")))
5 | folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
6 |
7 | Pod::Spec.new do |s|
8 | s.name = "ReactNativeMatrixSdk"
9 | s.version = package["version"]
10 | s.summary = package["description"]
11 | s.homepage = package["homepage"]
12 | s.license = package["license"]
13 | s.authors = package["author"]
14 |
15 | s.platforms = { :ios => min_ios_version_supported }
16 | s.source = { :git => "https://github.com/unomed-dev/react-native-matrix-sdk.git", :tag => "#{s.version}" }
17 |
18 | s.source_files = "ios/**/*.{h,m,mm,swift}", "ios/generated/**/*.{h,m,mm}", "cpp/**/*.{hpp,cpp,c,h}", "cpp/generated/**/*.{hpp,cpp,c,h}"
19 | s.vendored_frameworks = "build/RnMatrixRustSdk.xcframework"
20 | s.dependency "uniffi-bindgen-react-native", "0.29.3-1"
21 |
22 | # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
23 | # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
24 | if respond_to?(:install_modules_dependencies, true)
25 | install_modules_dependencies(s)
26 | else
27 | s.dependency "React-Core"
28 |
29 | # Don't install the dependencies when we run `pod install` in the old architecture.
30 | if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
31 | s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
32 | s.pod_target_xcconfig = {
33 | "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
34 | "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
35 | "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
36 | }
37 | s.dependency "React-Codegen"
38 | s.dependency "RCT-Folly"
39 | s.dependency "RCTRequired"
40 | s.dependency "RCTTypeSafety"
41 | s.dependency "ReactCommon/turbomodule/core"
42 | end
43 | end
44 | end
--------------------------------------------------------------------------------
/.github/workflows/build-ios.yml:
--------------------------------------------------------------------------------
1 | name: Build (iOS)
2 | on:
3 | push:
4 | branches:
5 | - main
6 | pull_request:
7 | branches:
8 | - main
9 | workflow_dispatch:
10 |
11 | jobs:
12 | build:
13 | runs-on: macos-14
14 | env:
15 | TURBO_CACHE_DIR: .turbo/ios
16 |
17 | steps:
18 | - name: Checkout
19 | uses: actions/checkout@v4
20 |
21 | - name: Generate
22 | uses: ./.github/actions/generate
23 | with:
24 | platform: ios
25 | release: false
26 |
27 | - name: Cache turborepo for iOS
28 | uses: actions/cache@v4
29 | with:
30 | path: ${{ env.TURBO_CACHE_DIR }}
31 | key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }}
32 | restore-keys: |
33 | ${{ runner.os }}-turborepo-ios-
34 |
35 | - name: Check turborepo cache for iOS
36 | run: |
37 | TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:ios').cache.status")
38 |
39 | if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
40 | echo "turbo_cache_hit=1" >> $GITHUB_ENV
41 | fi
42 |
43 | - name: Cache cocoapods
44 | if: env.turbo_cache_hit != 1
45 | id: cocoapods-cache
46 | uses: actions/cache@v4
47 | with:
48 | path: |
49 | **/ios/Pods
50 | key: ${{ runner.os }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }}
51 | restore-keys: |
52 | ${{ runner.os }}-cocoapods-
53 |
54 | - name: Install cocoapods
55 | if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
56 | run: |
57 | cd example/ios
58 |
59 | # Work around '[!] CocoaPods could not find compatible versions for pod "hermes-engine"'
60 | pod update hermes-engine --no-repo-update
61 |
62 | pod install
63 | env:
64 | NO_FLIPPER: 1
65 |
66 | - name: Build example for iOS
67 | run: |
68 | yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
69 |
--------------------------------------------------------------------------------
/.github/workflows/build-android.yml:
--------------------------------------------------------------------------------
1 | name: Build (Android)
2 | on:
3 | push:
4 | branches:
5 | - main
6 | pull_request:
7 | branches:
8 | - main
9 | workflow_dispatch:
10 |
11 | jobs:
12 | build:
13 | runs-on: ubuntu-latest
14 | env:
15 | TURBO_CACHE_DIR: .turbo/android
16 |
17 | steps:
18 | - name: Checkout
19 | uses: actions/checkout@v4
20 |
21 | - name: Generate
22 | uses: ./.github/actions/generate
23 | with:
24 | platform: android
25 | release: false
26 |
27 | - name: Cache turborepo for Android
28 | uses: actions/cache@v4
29 | with:
30 | path: ${{ env.TURBO_CACHE_DIR }}
31 | key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }}
32 | restore-keys: |
33 | ${{ runner.os }}-turborepo-android-
34 |
35 | - name: Check turborepo cache for Android
36 | run: |
37 | TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status")
38 |
39 | if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
40 | echo "turbo_cache_hit=1" >> $GITHUB_ENV
41 | fi
42 |
43 | - name: Install JDK
44 | if: env.turbo_cache_hit != 1
45 | uses: actions/setup-java@v3
46 | with:
47 | distribution: 'zulu'
48 | java-version: '17'
49 |
50 | - name: Finalize Android SDK
51 | if: env.turbo_cache_hit != 1
52 | run: |
53 | /bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
54 |
55 | - name: Cache Gradle
56 | if: env.turbo_cache_hit != 1
57 | uses: actions/cache@v4
58 | with:
59 | path: |
60 | ~/.gradle/wrapper
61 | ~/.gradle/caches
62 | key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
63 | restore-keys: |
64 | ${{ runner.os }}-gradle-
65 |
66 | - name: Build example for Android
67 | env:
68 | JAVA_OPTS: "-XX:MaxHeapSize=6g"
69 | run: |
70 | yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
71 |
--------------------------------------------------------------------------------
/src/index.tsx:
--------------------------------------------------------------------------------
1 | // Generated by uniffi-bindgen-react-native
2 | import installer from './NativeReactNativeMatrixSdk';
3 |
4 | // Register the rust crate with Hermes
5 | // - the boolean flag ensures this loads exactly once, even if the JS
6 | // code is reloaded (e.g. during development with metro).
7 | let rustInstalled = false;
8 | if (!rustInstalled) {
9 | installer.installRustCrate();
10 | rustInstalled = true;
11 | }
12 |
13 | // Export the generated bindings to the app.
14 | export * from './generated/matrix_sdk';
15 | export * from './generated/matrix_sdk_base';
16 | export * from './generated/matrix_sdk_common';
17 | export * from './generated/matrix_sdk_crypto';
18 | export * from './generated/matrix_sdk_ffi';
19 | export * from './generated/matrix_sdk_ui';
20 |
21 | // Now import the bindings so we can:
22 | // - intialize them
23 | // - export them as namespaced objects as the default export.
24 | import * as matrix_sdk from './generated/matrix_sdk';
25 | import * as matrix_sdk_base from './generated/matrix_sdk_base';
26 | import * as matrix_sdk_common from './generated/matrix_sdk_common';
27 | import * as matrix_sdk_crypto from './generated/matrix_sdk_crypto';
28 | import * as matrix_sdk_ffi from './generated/matrix_sdk_ffi';
29 | import * as matrix_sdk_ui from './generated/matrix_sdk_ui';
30 |
31 | // Initialize the generated bindings: mostly checksums, but also callbacks.
32 | // - the boolean flag ensures this loads exactly once, even if the JS code
33 | // is reloaded (e.g. during development with metro).
34 | let initialized = false;
35 | if (!initialized) {
36 | matrix_sdk.default.initialize();
37 | matrix_sdk_base.default.initialize();
38 | matrix_sdk_common.default.initialize();
39 | matrix_sdk_crypto.default.initialize();
40 | matrix_sdk_ffi.default.initialize();
41 | matrix_sdk_ui.default.initialize();
42 | initialized = true;
43 | }
44 |
45 | // This provides parity with the index.web.ts version of this file.
46 | // The web version relies on an asynchronous fetch, which this doesn't
47 | // need, so we just no-op.
48 | export async function uniffiInitAsync() {
49 | // NOOP.
50 | }
51 |
52 | // Export the crates as individually namespaced objects.
53 | export default {
54 | matrix_sdk,
55 | matrix_sdk_base,
56 | matrix_sdk_common,
57 | matrix_sdk_crypto,
58 | matrix_sdk_ffi,
59 | matrix_sdk_ui,
60 | };
61 |
62 |
--------------------------------------------------------------------------------
/example/ios/ReactNativeMatrixSdkExampleTests/ReactNativeMatrixSdkExampleTests.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | #import
5 | #import
6 |
7 | #define TIMEOUT_SECONDS 600
8 | #define TEXT_TO_LOOK_FOR @"Welcome to React"
9 |
10 | @interface ReactNativeMatrixSdkExampleTests : XCTestCase
11 |
12 | @end
13 |
14 | @implementation ReactNativeMatrixSdkExampleTests
15 |
16 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test
17 | {
18 | if (test(view)) {
19 | return YES;
20 | }
21 | for (UIView *subview in [view subviews]) {
22 | if ([self findSubviewInView:subview matching:test]) {
23 | return YES;
24 | }
25 | }
26 | return NO;
27 | }
28 |
29 | - (void)testRendersWelcomeScreen
30 | {
31 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
32 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
33 | BOOL foundElement = NO;
34 |
35 | __block NSString *redboxError = nil;
36 | #ifdef DEBUG
37 | RCTSetLogFunction(
38 | ^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
39 | if (level >= RCTLogLevelError) {
40 | redboxError = message;
41 | }
42 | });
43 | #endif
44 |
45 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
46 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
47 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
48 |
49 | foundElement = [self findSubviewInView:vc.view
50 | matching:^BOOL(UIView *view) {
51 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
52 | return YES;
53 | }
54 | return NO;
55 | }];
56 | }
57 |
58 | #ifdef DEBUG
59 | RCTSetLogFunction(RCTDefaultLogFunction);
60 | #endif
61 |
62 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
63 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
64 | }
65 |
66 | @end
67 |
--------------------------------------------------------------------------------
/.github/actions/generate/action.yml:
--------------------------------------------------------------------------------
1 | name: Generate
2 | description: Set up dependencies and regenerate the bindings
3 |
4 | inputs:
5 | platform:
6 | description: One of android, ios
7 | required: true
8 | release:
9 | description: Whether to build in release mode, one of true, false
10 | default: "false"
11 |
12 | runs:
13 | using: composite
14 | steps:
15 | - name: Setup JS
16 | uses: ./.github/actions/setup-js
17 |
18 | - name: Setup Rust (Android)
19 | if: ${{ inputs.platform == 'android' }}
20 | uses: dtolnay/rust-toolchain@stable
21 | with:
22 | targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
23 |
24 | - name: Setup Rust (iOS)
25 | if: ${{ inputs.platform == 'ios' }}
26 | uses: dtolnay/rust-toolchain@stable
27 | with:
28 | targets: aarch64-apple-ios,aarch64-apple-ios-sim,x86_64-apple-ios
29 |
30 | - name: Install cargo-ndk
31 | if: ${{ inputs.platform == 'android' }}
32 | shell: bash
33 | run: cargo install cargo-ndk --version 3.5.4
34 |
35 | - name: Install clang-format
36 | if: ${{ inputs.platform == 'ios' }}
37 | shell: bash
38 | run: brew install clang-format
39 |
40 | - name: Write .xcode.env.local
41 | if: ${{ inputs.platform == 'ios' }}
42 | shell: bash
43 | run: |
44 | # Work around for https://github.com/facebook/react-native/issues/35657
45 | echo "export NODE_BINARY=$(which node)" >> example/ios/.xcode.env.local
46 | cat example/ios/.xcode.env.local
47 |
48 | - name: Generate
49 | shell: bash
50 | env:
51 | INFIX: ${{ inputs.release == 'true' && ':release' || '' }}
52 | SUFFIX: ${{ inputs.platform == 'android' && ':android' || ':ios' }}
53 | run:
54 | yarn generate$INFIX$SUFFIX
55 |
56 | - name: Free space
57 | shell: bash
58 | run: rm -rf rust_modules
59 |
60 | - name: Check if repository is dirty
61 | shell: bash
62 | env:
63 | EXCLUDE: ${{ inputs.platform == 'android' && 'ios' || 'android' }}
64 | run: |
65 | if [[ -n "$(git status --porcelain | grep -v ". $EXCLUDE" | grep -v swift | grep -v example/ios/Podfile.lock)" ]]; then
66 | >&2 echo "Found unexpected changes in repository after generating"
67 | git status --short
68 | git diff
69 | exit 1
70 | fi
71 |
--------------------------------------------------------------------------------
/cpp/generated/matrix_sdk_ui.hpp:
--------------------------------------------------------------------------------
1 | // This file was autogenerated by some hot garbage in the
2 | // `uniffi-bindgen-react-native` crate. Trust me, you don't want to mess with
3 | // it!
4 | #pragma once
5 | #include "UniffiCallInvoker.h"
6 | #include
7 | #include
8 | #include
9 | #include