File tree Expand file tree Collapse file tree 3 files changed +48
-8
lines changed
main/java/com/margelo/rnquicksqlite
newarch/com/margelo/rnquicksqlite
oldarch/com/margelo/rnquicksqlite Expand file tree Collapse file tree 3 files changed +48
-8
lines changed Original file line number Diff line number Diff line change 1+ package com.margelo.rnquicksqlite
2+
3+ import com.facebook.react.TurboReactPackage
4+ import com.facebook.react.bridge.NativeModule
5+ import com.facebook.react.bridge.ReactApplicationContext
6+ import com.facebook.react.module.model.ReactModuleInfo
7+ import com.facebook.react.module.model.ReactModuleInfoProvider
8+
9+ class RNQuickSQLitePackage : TurboReactPackage () {
10+ override fun getModule (name : String , reactContext : ReactApplicationContext ): NativeModule ? {
11+ return if (name == RNQuickSQLiteOnLoadModule .NAME ) {
12+ RNQuickSQLiteOnLoadModule (reactContext)
13+ } else {
14+ null
15+ }
16+ }
17+
18+ override fun getReactModuleInfoProvider (): ReactModuleInfoProvider {
19+ return ReactModuleInfoProvider {
20+ val moduleInfos: MutableMap <String , ReactModuleInfo > = HashMap ()
21+ val isTurboModule: Boolean = BuildConfig .IS_NEW_ARCHITECTURE_ENABLED
22+ moduleInfos[RNQuickSQLiteOnLoadModule .NAME ] = ReactModuleInfo (
23+ RNQuickSQLiteOnLoadModule .NAME ,
24+ RNQuickSQLiteOnLoadModule .NAME ,
25+ canOverrideExistingModule= false ,
26+ needsEagerInit= true ,
27+ hasConstants= true ,
28+ isCxxModule= false ,
29+ isTurboModule= isTurboModule
30+ )
31+ moduleInfos
32+ }
33+ }
34+
35+ companion object {
36+ init {
37+ System .loadLibrary(" RNQuickSQLite" )
38+ }
39+ }
40+ }
Original file line number Diff line number Diff line change 1- package com.margelo.rnnitrosqlite
1+ package com.margelo.rnquicksqlite
22
33import com.facebook.react.bridge.Callback
44import com.facebook.react.bridge.ReactApplicationContext
5- import com.margelo.rnnitrosqlite.NativeNitroSQLiteOnLoadSpec
5+ import com.margelo.rnquicksqlite.NativeQuickSQLiteOnLoadSpec
66
7- class RNNitroSQLiteOnLoadModule (reactContext : ReactApplicationContext ) :
8- NativeNitroSQLiteOnLoadSpec (reactContext) {
7+ class RNQuickSQLiteOnLoadModule (reactContext : ReactApplicationContext ) :
8+ NativeQuickSQLiteOnLoadSpec (reactContext) {
99 private var reactApplicationContextReadyCallback: Callback ? = null
1010
1111 init {
@@ -31,7 +31,7 @@ class RNNitroSQLiteOnLoadModule(reactContext: ReactApplicationContext) :
3131 }
3232
3333 companion object {
34- const val NAME : String = " RNNitroSQLiteOnLoad "
34+ const val NAME : String = " RNQuickSQLiteOnLoad "
3535
3636 var reactContext: ReactApplicationContext ? = null
3737 private set
Original file line number Diff line number Diff line change 1- package com.margelo.rnnitrosqlite
1+ package com.margelo.rnquicksqlite
22
33import com.facebook.react.bridge.Callback
44import com.facebook.react.bridge.ReactApplicationContext
55import com.facebook.react.bridge.ReactContextBaseJavaModule
66import com.facebook.react.bridge.ReactMethod
77
8- class RNNitroSQLiteOnLoadModule (reactContext : ReactApplicationContext ) :
8+ class RNQuickSQLiteOnLoadModule (reactContext : ReactApplicationContext ) :
99 ReactContextBaseJavaModule (reactContext) {
1010
1111
@@ -33,7 +33,7 @@ class RNNitroSQLiteOnLoadModule(reactContext: ReactApplicationContext) :
3333 }
3434
3535 companion object {
36- const val NAME : String = " RNNitroSQLiteOnLoad "
36+ const val NAME : String = " RNNQuickSQLiteOnLoad "
3737
3838 var reactContext: ReactApplicationContext ? = null
3939 private set
You can’t perform that action at this time.
0 commit comments