@walletconnect/react-native-compat 2.21.5-canary-native-fix.2 → 2.21.5-canary-1

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("../module/")
117
- libraryName = "RNWalletConnectModuleSpec"
116
+ jsRootDir = file("../src/")
117
+ libraryName = "RNWalletConnectModule"
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 fun getTypedExportedConstants(): Map<String, String> {
15
+ override protected fun getTypedExportedConstants(): Map<String, String> {
16
16
  var appName: String
17
17
 
18
18
  try {
19
- appName = reactApplicationContext.applicationInfo
20
- .loadLabel(reactApplicationContext.packageManager).toString()
19
+ appName = getReactApplicationContext().getApplicationInfo()
20
+ .loadLabel(getReactApplicationContext().getPackageManager()).toString()
21
21
  } catch (e: Exception) {
22
22
  appName = "unknown"
23
23
  }
24
24
 
25
25
  val constants: MutableMap<String, String> = HashMap()
26
- constants["applicationId"] = reactApplicationContext.packageName
27
- constants["applicationName"] = appName
26
+ constants.put("applicationId", getReactApplicationContext().getPackageName());
27
+ constants.put("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 = reactApplicationContext.packageManager
42
+ val manager: PackageManager = getReactApplicationContext().getPackageManager()
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,16 +1,7 @@
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
6
4
 
7
5
  abstract class RNWalletConnectModuleSpec internal constructor(context: ReactApplicationContext) :
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
- }
6
+ NativeRNWalletConnectModuleSpec(context) {
16
7
  }
@@ -7,10 +7,11 @@ 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
- return getTypedExportedConstants()
14
+ val constants: Map<String, String> = getTypedExportedConstants()
15
+ return constants
15
16
  }
16
17
  }
@@ -1,5 +1,6 @@
1
+
1
2
  #ifdef RCT_NEW_ARCH_ENABLED
2
- #import "RNWalletConnectModuleSpec.h"
3
+ #import "RNRNWalletConnectModuleSpec.h"
3
4
 
4
5
  @interface RNWalletConnectModule : NSObject <NativeRNWalletConnectModuleSpec>
5
6
  #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.5-canary-native-fix.2",
4
+ "version": "2.21.5-canary-1",
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": "RNWalletConnectModuleSpec",
56
+ "name": "RNRNWalletConnectModuleSpec",
57
57
  "type": "modules",
58
- "jsSrcsDir": "module"
58
+ "jsSrcsDir": "."
59
59
  }
60
60
  }