@expensify/react-native-wallet 0.1.8 → 0.1.10

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.
@@ -8,7 +8,7 @@ buildscript {
8
8
  }
9
9
 
10
10
  dependencies {
11
- classpath "com.android.tools.build:gradle:7.2.1"
11
+ classpath "com.android.tools.build:gradle:7.3.1"
12
12
  // noinspection DifferentKotlinGradleVersion
13
13
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14
14
  }
@@ -1,5 +1,5 @@
1
- Wallet_kotlinVersion=1.8.0
2
- Wallet_minSdkVersion=21
3
- Wallet_targetSdkVersion=34
4
- Wallet_compileSdkVersion=34
1
+ Wallet_kotlinVersion=2.1.20
2
+ Wallet_minSdkVersion=24
3
+ Wallet_targetSdkVersion=36
4
+ Wallet_compileSdkVersion=36
5
5
  Wallet_ndkversion=27.1.12297006
@@ -43,11 +43,10 @@ class WalletModule internal constructor(context: ReactApplicationContext) :
43
43
 
44
44
  const val E_SDK_API = "SDK API Error"
45
45
  const val E_OPERATION_FAILED = "E_OPERATION_FAILED"
46
- const val E_NO_TOKENS_AVAILABLE = "E_NO_TOKENS_AVAILABLE"
47
46
  const val E_INVALID_DATA = "E_INVALID_DATA"
48
47
  }
49
48
 
50
- private val activity = currentActivity ?: throw ActivityNotFoundException()
49
+ private val activity = reactApplicationContext.currentActivity ?: throw ActivityNotFoundException()
51
50
  private val tapAndPayClient: TapAndPayClient = TapAndPay.getClient(activity)
52
51
  private var pendingCreateWalletPromise: Promise? = null
53
52
  private var pendingPushTokenizePromise: Promise? = null
@@ -64,14 +63,14 @@ class WalletModule internal constructor(context: ReactApplicationContext) :
64
63
 
65
64
  private val cardListener = object : ActivityEventListener {
66
65
  override fun onActivityResult(
67
- activity: Activity?, requestCode: Int, resultCode: Int, intent: Intent?
66
+ activity: Activity, requestCode: Int, resultCode: Int, data: Intent?
68
67
  ) {
69
68
  if (requestCode == REQUEST_CREATE_WALLET) {
70
69
  pendingCreateWalletPromise?.resolve(resultCode == RESULT_OK)
71
70
  pendingCreateWalletPromise = null
72
71
  } else if (requestCode == REQUEST_CODE_PUSH_TOKENIZE) {
73
72
  if (resultCode == RESULT_OK) {
74
- intent?.let {
73
+ data?.let {
75
74
  val tokenId = it.getStringExtra(TapAndPay.EXTRA_ISSUER_TOKEN_ID).toString()
76
75
  sendEvent(
77
76
  context,
@@ -91,7 +90,7 @@ class WalletModule internal constructor(context: ReactApplicationContext) :
91
90
  }
92
91
  }
93
92
 
94
- override fun onNewIntent(p0: Intent?) {}
93
+ override fun onNewIntent(intent: Intent) {}
95
94
  }
96
95
 
97
96
  @ReactMethod
@@ -1,6 +1,6 @@
1
1
  package com.expensify.wallet
2
2
 
3
- import com.expensify.wallet.components.AddToWalletButtonViewManager
3
+ import com.expensify.wallet.components.RNAddToWalletButtonManager
4
4
  import com.facebook.react.BaseReactPackage
5
5
  import com.facebook.react.bridge.ReactApplicationContext
6
6
  import com.facebook.react.bridge.NativeModule
@@ -44,5 +44,5 @@ class WalletPackage : BaseReactPackage() {
44
44
  }
45
45
 
46
46
  override fun createViewManagers(reactContext: com.facebook.react.bridge.ReactApplicationContext)
47
- : List<ViewManager<*, *>> = listOf(AddToWalletButtonViewManager())
47
+ : List<ViewManager<*, *>> = listOf(RNAddToWalletButtonManager())
48
48
  }
@@ -4,16 +4,16 @@ import com.facebook.react.uimanager.SimpleViewManager
4
4
  import com.facebook.react.uimanager.ThemedReactContext
5
5
  import com.facebook.react.uimanager.annotations.ReactProp
6
6
 
7
- class AddToWalletButtonViewManager : SimpleViewManager<AddToWalletButtonView>() {
7
+ class RNAddToWalletButtonManager : SimpleViewManager<RNAddToWalletButtonView>() {
8
8
 
9
9
  override fun getName(): String = "RNAddToWalletButton"
10
10
 
11
- override fun createViewInstance(reactContext: ThemedReactContext): AddToWalletButtonView {
12
- return AddToWalletButtonView(reactContext)
11
+ override fun createViewInstance(reactContext: ThemedReactContext): RNAddToWalletButtonView {
12
+ return RNAddToWalletButtonView(reactContext)
13
13
  }
14
14
 
15
15
  @ReactProp(name = "buttonType")
16
- fun setButtonType(view: AddToWalletButtonView, type: String) {
16
+ fun setButtonType(view: RNAddToWalletButtonView, type: String) {
17
17
  view.setButtonType(type)
18
18
  }
19
19
  }
@@ -6,7 +6,7 @@ import com.expensify.wallet.R
6
6
  import android.view.LayoutInflater
7
7
  import android.view.View
8
8
 
9
- class AddToWalletButtonView(context: Context) : FrameLayout(context) {
9
+ class RNAddToWalletButtonView(context: Context) : FrameLayout(context) {
10
10
 
11
11
  private var buttonView: View? = null
12
12
  private var buttonType: String = "basic"
@@ -4,7 +4,7 @@ import React
4
4
  @objc(RNAddToWalletButtonManager)
5
5
  class RNAddToWalletButtonManager: RCTViewManager {
6
6
  override func view() -> UIView! {
7
- return AddToWalletButtonView()
7
+ return RNAddToWalletButtonView()
8
8
  }
9
9
 
10
10
  override static func requiresMainQueueSetup() -> Bool {
@@ -2,8 +2,8 @@ import Foundation
2
2
  import PassKit
3
3
  import UIKit
4
4
 
5
- @objc(AddToWalletButtonView)
6
- class AddToWalletButtonView: UIView {
5
+ @objc(RNAddToWalletButtonView)
6
+ class RNAddToWalletButtonView: UIView {
7
7
  private var addPassButton = PKAddPassButton(addPassButtonStyle: .blackOutline)
8
8
  private let defaultWidth: CGFloat = 120
9
9
  private let defaultHeight: CGFloat = 40
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expensify/react-native-wallet",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "A React Native module designed for seamless integration of Card Push Provisioning into Apple Wallet and Google Wallet, enabling easy and secure addition of payment cards directly from your application.",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "lib/commonjs/index",
@@ -64,14 +64,14 @@
64
64
  "@commitlint/config-conventional": "^17.0.2",
65
65
  "@evilmartians/lefthook": "^1.5.0",
66
66
  "@lwc/eslint-plugin-lwc": "^1.7.2",
67
- "@react-native-community/cli": "18.0.0",
68
- "@react-native-community/cli-platform-android": "18.0.0",
69
- "@react-native-community/cli-platform-ios": "18.0.0",
70
- "@react-native/eslint-config": "0.79.2",
71
- "@react-native/gradle-plugin": "0.79.2",
67
+ "@react-native-community/cli": "20.0.0",
68
+ "@react-native-community/cli-platform-android": "20.0.0",
69
+ "@react-native-community/cli-platform-ios": "20.0.0",
70
+ "@react-native/eslint-config": "0.81.0",
71
+ "@react-native/gradle-plugin": "0.81.0",
72
72
  "@release-it/conventional-changelog": "^5.0.0",
73
73
  "@types/jest": "^29.5.14",
74
- "@types/react": "^19.0.0",
74
+ "@types/react": "^19.1.0",
75
75
  "@typescript-eslint/eslint-plugin": "^6.15.0",
76
76
  "@typescript-eslint/parser": "^6.15.0",
77
77
  "del-cli": "^5.0.0",
@@ -90,12 +90,12 @@
90
90
  "eslint-plugin-tsdoc": "^0.2.17",
91
91
  "jest": "^29.6.3",
92
92
  "prettier": "2.8.8",
93
- "react": "^19.0.0",
94
- "react-native": "0.79.2",
93
+ "react": "19.1.0",
94
+ "react-native": "0.81.0",
95
95
  "react-native-builder-bob": "^0.20.0",
96
96
  "release-it": "^15.0.0",
97
97
  "turbo": "^1.10.7",
98
- "typescript": "~5.3.3"
98
+ "typescript": "^5.8.3"
99
99
  },
100
100
  "peerDependencies": {
101
101
  "react": "*",