@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.
@@ -113,8 +113,8 @@ dependencies {
113
113
 
114
114
  if (isNewArchitectureEnabled()) {
115
115
  react {
116
- jsRootDir = file("../src/")
117
- libraryName = "RNWalletConnectModule"
116
+ jsRootDir = file("../module/")
117
+ libraryName = "RNWalletConnectModuleSpec"
118
118
  codegenJavaPackageName = "com.walletconnect.reactnativemodule"
119
119
  }
120
120
  }
@@ -12,19 +12,19 @@ class RNWalletConnectModuleModule internal constructor(context: ReactApplication
12
12
  return NAME
13
13
  }
14
14
 
15
- override protected fun getTypedExportedConstants(): Map<String, String> {
15
+ override fun getTypedExportedConstants(): Map<String, String> {
16
16
  var appName: String
17
17
 
18
18
  try {
19
- appName = getReactApplicationContext().getApplicationInfo()
20
- .loadLabel(getReactApplicationContext().getPackageManager()).toString()
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.put("applicationId", getReactApplicationContext().getPackageName());
27
- constants.put("applicationName", appName);
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 = getReactApplicationContext().getPackageManager()
42
+ val manager: PackageManager = reactApplicationContext.packageManager
43
43
  return try {
44
44
  @Suppress("DEPRECATION")
45
45
  manager.getPackageInfo(packageName, 0)
@@ -26,7 +26,7 @@ class RNWalletConnectModulePackage : TurboReactPackage() {
26
26
  false, // canOverrideExistingModule
27
27
  false, // needsEagerInit
28
28
  true, // hasConstants
29
- false, // isCxxModule
29
+ false, // isCxxModule,
30
30
  isTurboModule // isTurboModule
31
31
  )
32
32
  moduleInfos
@@ -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
- NativeRNWalletConnectModuleSpec(context) {
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
- val constants: Map<String, String> = getTypedExportedConstants()
15
- return constants
14
+ return getTypedExportedConstants()
16
15
  }
17
16
  }
@@ -1,6 +1,5 @@
1
-
2
1
  #ifdef RCT_NEW_ARCH_ENABLED
3
- #import "RNRNWalletConnectModuleSpec.h"
2
+ #import "RNWalletConnectModuleSpec.h"
4
3
 
5
4
  @interface RNWalletConnectModule : NSObject <NativeRNWalletConnectModuleSpec>
6
5
  #else
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",
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": "RNRNWalletConnectModuleSpec",
56
+ "name": "RNWalletConnectModuleSpec",
57
57
  "type": "modules",
58
- "jsSrcsDir": "."
58
+ "jsSrcsDir": "module"
59
59
  }
60
60
  }