Skip to content

Commit 64e4281

Browse files
authored
Merge pull request #85 from patrickkabwe/feat/new-nitro
Feat/new nitro
2 parents 52f3bbc + f0582c9 commit 64e4281

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1989
-970
lines changed

.github/workflows/ios-build.yml

Lines changed: 14 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

@@ -95,6 +100,11 @@ jobs:
95100
- name: Install npm dependencies (bun)
96101
run: bun install
97102

103+
- name: Setup Xcode
104+
uses: maxim-lobanov/setup-xcode@v1
105+
with:
106+
xcode-version: latest-stable
107+
98108
- name: Disable new architecture in Podfile
99109
run: sed -i "" "s/ENV\['RCT_NEW_ARCH_ENABLED'\] = '1'/ENV['RCT_NEW_ARCH_ENABLED'] = '0'/g" example/ios/Podfile
100110

@@ -133,4 +143,4 @@ jobs:
133143
-configuration Debug \
134144
-destination 'platform=iOS Simulator,name=iPhone 16' \
135145
build \
136-
CODE_SIGNING_ALLOWED=NO | xcpretty"
146+
CODE_SIGNING_ALLOWED=NO | xcpretty"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ A Simple React Native Nitro module for in-app browser.
1919
2020

2121
```sh
22-
bun install react-native-nitro-in-app-browser react-native-nitro-modules@0.26.3
22+
bun install react-native-nitro-in-app-browser react-native-nitro-modules@0.28.0
2323
cd ios && pod install && cd ..
2424
```
2525

bun.lock

Lines changed: 185 additions & 107 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: NitroInAppBrowserPresentationStyle.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

0 commit comments

Comments
 (0)