Skip to content

Commit a5406dd

Browse files
zfurtakSkalakid
andauthored
Bump React Native to 0.81.0 (#38)
* Remove Expo from library * Add missing blank lines * All the required code for bump * Lint fixes * Update library RN to 0.81.0 * Update Android Gradle Plugin version to 7.3.1 * Update prettierrc * Fix WalletModule * Update deprecated code * Remove unnecessary dependency * Run pod install * Revert prettier changes * Add review changes * Add SafeAreaView --------- Co-authored-by: Michał Skałka <michal.skalka@swmansion.com>
1 parent e7b2c5f commit a5406dd

File tree

20 files changed

+1654
-1523
lines changed

20 files changed

+1654
-1523
lines changed

.prettierrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ module.exports = {
22
tabWidth: 2,
33
singleQuote: true,
44
trailingComma: 'all',
5-
bracketSpacing: false,
65
arrowParens: 'always',
6+
bracketSpacing: false,
77
printWidth: 190,
88
singleAttributePerLine: true,
99
};

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ buildscript {
88
}
99

1010
dependencies {
11-
classpath "com.android.tools.build:gradle:7.2.1"
11+
classpath "com.android.tools.build:gradle:7.3.1"
1212
// noinspection DifferentKotlinGradleVersion
1313
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1414
}

android/gradle.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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
55
Wallet_ndkversion=27.1.12297006
260 Bytes
Binary file not shown.

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

android/src/main/java/com/expensify/wallet/WalletModule.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,10 @@ class WalletModule internal constructor(context: ReactApplicationContext) :
4343

4444
const val E_SDK_API = "SDK API Error"
4545
const val E_OPERATION_FAILED = "E_OPERATION_FAILED"
46-
const val E_NO_TOKENS_AVAILABLE = "E_NO_TOKENS_AVAILABLE"
4746
const val E_INVALID_DATA = "E_INVALID_DATA"
4847
}
4948

50-
private val activity = currentActivity ?: throw ActivityNotFoundException()
49+
private val activity = reactApplicationContext.currentActivity ?: throw ActivityNotFoundException()
5150
private val tapAndPayClient: TapAndPayClient = TapAndPay.getClient(activity)
5251
private var pendingCreateWalletPromise: Promise? = null
5352
private var pendingPushTokenizePromise: Promise? = null
@@ -64,14 +63,14 @@ class WalletModule internal constructor(context: ReactApplicationContext) :
6463

6564
private val cardListener = object : ActivityEventListener {
6665
override fun onActivityResult(
67-
activity: Activity?, requestCode: Int, resultCode: Int, intent: Intent?
66+
activity: Activity, requestCode: Int, resultCode: Int, data: Intent?
6867
) {
6968
if (requestCode == REQUEST_CREATE_WALLET) {
7069
pendingCreateWalletPromise?.resolve(resultCode == RESULT_OK)
7170
pendingCreateWalletPromise = null
7271
} else if (requestCode == REQUEST_CODE_PUSH_TOKENIZE) {
7372
if (resultCode == RESULT_OK) {
74-
intent?.let {
73+
data?.let {
7574
val tokenId = it.getStringExtra(TapAndPay.EXTRA_ISSUER_TOKEN_ID).toString()
7675
sendEvent(
7776
context,
@@ -91,7 +90,7 @@ class WalletModule internal constructor(context: ReactApplicationContext) :
9190
}
9291
}
9392

94-
override fun onNewIntent(p0: Intent?) {}
93+
override fun onNewIntent(intent: Intent) {}
9594
}
9695

9796
@ReactMethod

example/.prettierrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
module.exports = {
22
arrowParens: 'avoid',
3-
bracketSameLine: true,
43
bracketSpacing: false,
54
singleQuote: true,
65
trailingComma: 'all',

example/android/app/src/main/java/com/expensify/walletexample/MainApplication.kt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ import com.facebook.react.ReactApplication
66
import com.facebook.react.ReactHost
77
import com.facebook.react.ReactNativeHost
88
import com.facebook.react.ReactPackage
9-
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
109
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
1110
import com.facebook.react.defaults.DefaultReactNativeHost
12-
import com.facebook.react.soloader.OpenSourceMergedSoMapping
13-
import com.facebook.soloader.SoLoader
11+
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
1412

1513
class MainApplication : Application(), ReactApplication {
1614

@@ -34,10 +32,6 @@ class MainApplication : Application(), ReactApplication {
3432

3533
override fun onCreate() {
3634
super.onCreate()
37-
SoLoader.init(this, OpenSourceMergedSoMapping)
38-
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
39-
// If you opted-in for the New Architecture, we load the native entry point for this app.
40-
load()
41-
}
35+
loadReactNative(this)
4236
}
4337
}

example/android/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
buildscript {
22
ext {
3-
buildToolsVersion = "35.0.0"
3+
buildToolsVersion = "36.0.0"
44
minSdkVersion = 24
5-
compileSdkVersion = 35
6-
targetSdkVersion = 35
5+
compileSdkVersion = 36
6+
targetSdkVersion = 36
77
ndkVersion = "27.1.12297006"
8-
kotlinVersion = "2.0.21"
8+
kotlinVersion = "2.1.20"
99
}
1010
repositories {
1111
google()

example/android/gradle.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,8 @@ newArchEnabled=true
3737
# Use this property to enable or disable the Hermes JS engine.
3838
# If set to false, you will be using JSC instead.
3939
hermesEnabled=true
40+
41+
# Use this property to enable edge-to-edge display support.
42+
# This allows your app to draw behind system bars for an immersive UI.
43+
# Note: Only works with ReactActivity and should not be used with custom Activity.
44+
edgeToEdgeEnabled=true

0 commit comments

Comments
 (0)