-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
95 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 0 additions & 46 deletions
46
android/src/main/java/com/unomed/reactnativematrixsdk/ReactNativeMatrixSdkModule.java
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
android/src/main/java/com/unomed/reactnativematrixsdk/ReactNativeMatrixSdkModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Generated by uniffi-bindgen-react-native | ||
package com.unomed.reactnativematrixsdk | ||
|
||
import com.facebook.react.bridge.ReactApplicationContext | ||
import com.facebook.react.module.annotations.ReactModule | ||
import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder | ||
|
||
@ReactModule(name = ReactNativeMatrixSdkModule.NAME) | ||
class ReactNativeMatrixSdkModule(reactContext: ReactApplicationContext) : | ||
NativeReactNativeMatrixSdkSpec(reactContext) { | ||
|
||
override fun getName(): String { | ||
return NAME | ||
} | ||
|
||
// Two native methods implemented in cpp-adapter.cpp, and ultimately | ||
// unomed-react-native-matrix-sdk.cpp | ||
|
||
external fun nativeInstallRustCrate(runtimePointer: Long, callInvoker: CallInvokerHolder): Boolean | ||
external fun nativeCleanupRustCrate(runtimePointer: Long): Boolean | ||
|
||
override fun installRustCrate(): Boolean { | ||
val context = this.reactApplicationContext | ||
return nativeInstallRustCrate( | ||
context.javaScriptContextHolder!!.get(), | ||
context.jsCallInvokerHolder!! | ||
) | ||
} | ||
|
||
override fun cleanupRustCrate(): Boolean { | ||
return nativeCleanupRustCrate( | ||
this.reactApplicationContext.javaScriptContextHolder!!.get() | ||
) | ||
} | ||
|
||
companion object { | ||
const val NAME = "ReactNativeMatrixSdk" | ||
|
||
init { | ||
System.loadLibrary("unomed-react-native-matrix-sdk") | ||
} | ||
} | ||
} |
45 changes: 0 additions & 45 deletions
45
android/src/main/java/com/unomed/reactnativematrixsdk/ReactNativeMatrixSdkPackage.java
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
android/src/main/java/com/unomed/reactnativematrixsdk/ReactNativeMatrixSdkPackage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Generated by uniffi-bindgen-react-native | ||
package com.unomed.reactnativematrixsdk | ||
|
||
import com.facebook.react.TurboReactPackage | ||
import com.facebook.react.bridge.NativeModule | ||
import com.facebook.react.bridge.ReactApplicationContext | ||
import com.facebook.react.module.model.ReactModuleInfo | ||
import com.facebook.react.module.model.ReactModuleInfoProvider | ||
import java.util.HashMap | ||
|
||
class ReactNativeMatrixSdkPackage : TurboReactPackage() { | ||
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? { | ||
return if (name == ReactNativeMatrixSdkModule.NAME) { | ||
ReactNativeMatrixSdkModule(reactContext) | ||
} else { | ||
null | ||
} | ||
} | ||
|
||
override fun getReactModuleInfoProvider(): ReactModuleInfoProvider { | ||
return ReactModuleInfoProvider { | ||
val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap() | ||
moduleInfos[ReactNativeMatrixSdkModule.NAME] = ReactModuleInfo( | ||
ReactNativeMatrixSdkModule.NAME, | ||
ReactNativeMatrixSdkModule.NAME, | ||
false, // canOverrideExistingModule | ||
false, // needsEagerInit | ||
false, // isCxxModule | ||
true // isTurboModule | ||
) | ||
moduleInfos | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters