Skip to content

Commit 1a4751a

Browse files
committed
chore: update dependencies and improve iOS build configuration
- Bump React and React Native versions to 19.1.0 and 0.81.0 respectively. - Update various development dependencies to their latest versions. - Modify iOS build workflow to include setup for the latest Xcode version. - Adjust Android build configuration to use updated SDK and build tools. - Refactor example app to utilize SafeAreaProvider and handle errors with alerts. - Remove deprecated properties from configuration files.
1 parent 5508dd5 commit 1a4751a

File tree

15 files changed

+1518
-858
lines changed

15 files changed

+1518
-858
lines changed

.github/workflows/ios-build.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ env:
3838
USE_CCACHE: 1
3939

4040
concurrency:
41-
group: ${{ github.workflow }}-${{ github.ref }}
42-
cancel-in-progress: true
43-
41+
group: ${{ github.workflow }}-${{ github.ref }}
42+
cancel-in-progress: true
43+
4444
jobs:
4545
build_new:
4646
name: Build iOS Example App (new architecture)
@@ -49,6 +49,11 @@ jobs:
4949
- uses: actions/checkout@v4
5050
- uses: oven-sh/setup-bun@v2
5151

52+
- name: Setup Xcode
53+
uses: maxim-lobanov/setup-xcode@v1
54+
with:
55+
xcode-version: latest-stable
56+
5257
- name: Install npm dependencies (bun)
5358
run: bun install
5459

@@ -133,4 +138,4 @@ jobs:
133138
-configuration Debug \
134139
-destination 'platform=iOS Simulator,name=iPhone 16' \
135140
build \
136-
CODE_SIGNING_ALLOWED=NO | xcpretty"
141+
CODE_SIGNING_ALLOWED=NO | xcpretty"

bun.lock

Lines changed: 73 additions & 103 deletions
Large diffs are not rendered by default.

example/.prettierrc.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
module.exports = {
22
arrowParens: 'avoid',
3-
bracketSameLine: true,
4-
bracketSpacing: false,
53
singleQuote: true,
64
trailingComma: 'all',
75
};

example/App.tsx

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import React from 'react';
2-
import {Button, SafeAreaView, StyleSheet} from 'react-native';
3-
import NitroInAppBrowser, {
4-
NitroInAppBrowserPresentationStyle,
5-
} from 'react-native-nitro-in-app-browser';
2+
import {Alert, Button, StyleSheet} from 'react-native';
3+
import NitroInAppBrowser from 'react-native-nitro-in-app-browser';
4+
import {SafeAreaProvider, SafeAreaView} from 'react-native-safe-area-context';
65

7-
const App = () => {
6+
const AppWrapper = () => {
87
return (
98
<SafeAreaView style={styles.container}>
109
<Button
@@ -15,17 +14,30 @@ const App = () => {
1514
barColor: 'purple',
1615
controlColor: '#000000',
1716
dismissButtonLabel: 'close',
18-
presentationStyle: "fullScreen",
17+
presentationStyle: 'fullScreen',
1918
});
2019
} catch (error) {
21-
console.error(error);
20+
Alert.alert('Error', (error as Error).message, [
21+
{
22+
text: 'OK',
23+
onPress: () => {},
24+
},
25+
]);
2226
}
2327
}}
2428
/>
2529
</SafeAreaView>
2630
);
2731
};
2832

33+
const App = () => {
34+
return (
35+
<SafeAreaProvider>
36+
<AppWrapper />
37+
</SafeAreaProvider>
38+
);
39+
};
40+
2941
export default App;
3042

3143
const styles = StyleSheet.create({

example/android/app/src/main/java/com/nitroinappbrowserexample/MainApplication.kt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ 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
9+
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
1010
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
1111
import com.facebook.react.defaults.DefaultReactNativeHost
12-
import com.facebook.react.soloader.OpenSourceMergedSoMapping
13-
import com.facebook.soloader.SoLoader
12+
13+
1414

1515
class MainApplication : Application(), ReactApplication {
1616

@@ -35,10 +35,6 @@ class MainApplication : Application(), ReactApplication {
3535

3636
override fun onCreate() {
3737
super.onCreate()
38-
SoLoader.init(this, OpenSourceMergedSoMapping)
39-
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
40-
// If you opted-in for the New Architecture, we load the native entry point for this app.
41-
load()
42-
}
38+
loadReactNative(this)
4339
}
4440
}

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=false
59 Bytes
Binary file not shown.

example/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.13-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

example/android/gradlew

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ case "$( uname )" in #(
114114
NONSTOP* ) nonstop=true ;;
115115
esac
116116

117-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
117+
CLASSPATH="\\\"\\\""
118118

119119

120120
# Determine the Java command to use to start the JVM.
@@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
213213
set -- \
214214
"-Dorg.gradle.appname=$APP_BASE_NAME" \
215215
-classpath "$CLASSPATH" \
216-
org.gradle.wrapper.GradleWrapperMain \
216+
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
217217
"$@"
218218

219219
# Stop when "xargs" is not available.

0 commit comments

Comments
 (0)