@walletconnect/react-native-compat 2.21.4 → 2.21.5-canary-native-fix.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/walletconnect/reactnativemodule/RNWalletConnectModuleModule.kt +6 -6
- package/android/src/main/java/com/walletconnect/reactnativemodule/RNWalletConnectModulePackage.kt +1 -1
- package/android/src/newarch/RNWalletConnectModuleSpec.kt +10 -1
- package/android/src/oldarch/RNWalletConnectModuleSpec.kt +2 -3
- package/ios/RNWalletConnectModule.h +1 -2
- package/package.json +3 -3
package/android/build.gradle
CHANGED
@@ -113,8 +113,8 @@ dependencies {
|
|
113
113
|
|
114
114
|
if (isNewArchitectureEnabled()) {
|
115
115
|
react {
|
116
|
-
jsRootDir = file("../
|
117
|
-
libraryName = "
|
116
|
+
jsRootDir = file("../module/")
|
117
|
+
libraryName = "RNWalletConnectModuleSpec"
|
118
118
|
codegenJavaPackageName = "com.walletconnect.reactnativemodule"
|
119
119
|
}
|
120
120
|
}
|
package/android/src/main/java/com/walletconnect/reactnativemodule/RNWalletConnectModuleModule.kt
CHANGED
@@ -12,19 +12,19 @@ class RNWalletConnectModuleModule internal constructor(context: ReactApplication
|
|
12
12
|
return NAME
|
13
13
|
}
|
14
14
|
|
15
|
-
override
|
15
|
+
override fun getTypedExportedConstants(): Map<String, String> {
|
16
16
|
var appName: String
|
17
17
|
|
18
18
|
try {
|
19
|
-
appName =
|
20
|
-
.loadLabel(
|
19
|
+
appName = reactApplicationContext.applicationInfo
|
20
|
+
.loadLabel(reactApplicationContext.packageManager).toString()
|
21
21
|
} catch (e: Exception) {
|
22
22
|
appName = "unknown"
|
23
23
|
}
|
24
24
|
|
25
25
|
val constants: MutableMap<String, String> = HashMap()
|
26
|
-
constants
|
27
|
-
constants
|
26
|
+
constants["applicationId"] = reactApplicationContext.packageName
|
27
|
+
constants["applicationName"] = appName
|
28
28
|
return constants
|
29
29
|
}
|
30
30
|
|
@@ -39,7 +39,7 @@ class RNWalletConnectModuleModule internal constructor(context: ReactApplication
|
|
39
39
|
}
|
40
40
|
|
41
41
|
private fun isPackageInstalled(packageName: String): Boolean {
|
42
|
-
val manager: PackageManager =
|
42
|
+
val manager: PackageManager = reactApplicationContext.packageManager
|
43
43
|
return try {
|
44
44
|
@Suppress("DEPRECATION")
|
45
45
|
manager.getPackageInfo(packageName, 0)
|
@@ -1,7 +1,16 @@
|
|
1
1
|
package com.walletconnect.reactnativemodule
|
2
2
|
|
3
3
|
import com.facebook.react.bridge.ReactApplicationContext
|
4
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
5
|
+
import com.facebook.react.bridge.Promise
|
4
6
|
|
5
7
|
abstract class RNWalletConnectModuleSpec internal constructor(context: ReactApplicationContext) :
|
6
|
-
|
8
|
+
ReactContextBaseJavaModule(context) {
|
9
|
+
|
10
|
+
abstract fun isAppInstalled(packageName: String?, promise: Promise)
|
11
|
+
protected abstract fun getTypedExportedConstants(): Map<String, String>
|
12
|
+
|
13
|
+
override fun getConstants(): Map<String, String> {
|
14
|
+
return getTypedExportedConstants()
|
15
|
+
}
|
7
16
|
}
|
@@ -7,11 +7,10 @@ import com.facebook.react.bridge.Promise
|
|
7
7
|
abstract class RNWalletConnectModuleSpec internal constructor(context: ReactApplicationContext) :
|
8
8
|
ReactContextBaseJavaModule(context) {
|
9
9
|
|
10
|
-
abstract fun isAppInstalled(packageName: String?, promise: Promise)
|
10
|
+
abstract fun isAppInstalled(packageName: String?, promise: Promise)
|
11
11
|
protected abstract fun getTypedExportedConstants(): Map<String, String>
|
12
12
|
|
13
13
|
override fun getConstants(): Map<String, String> {
|
14
|
-
|
15
|
-
return constants
|
14
|
+
return getTypedExportedConstants()
|
16
15
|
}
|
17
16
|
}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@walletconnect/react-native-compat",
|
3
3
|
"description": "Shims for WalletConnect Protocol in React Native Projects",
|
4
|
-
"version": "2.21.
|
4
|
+
"version": "2.21.5-canary-native-fix.2",
|
5
5
|
"author": "WalletConnect, Inc. <walletconnect.com>",
|
6
6
|
"homepage": "https://github.com/walletconnect/walletconnect-monorepo/",
|
7
7
|
"license": "Apache-2.0",
|
@@ -53,8 +53,8 @@
|
|
53
53
|
}
|
54
54
|
},
|
55
55
|
"codegenConfig": {
|
56
|
-
"name": "
|
56
|
+
"name": "RNWalletConnectModuleSpec",
|
57
57
|
"type": "modules",
|
58
|
-
"jsSrcsDir": "
|
58
|
+
"jsSrcsDir": "module"
|
59
59
|
}
|
60
60
|
}
|