Skip to content

Commit ef9ed6a

Browse files
committed
feat: update README with platform differences and behavior, enhance iOS modal presentation handling, and bump InAppBrowserNitro version to 1.1.0
1 parent 9922b7d commit ef9ed6a

File tree

5 files changed

+100
-87
lines changed

5 files changed

+100
-87
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,14 @@ const authenticateUser = async () => {
176176
};
177177
```
178178

179+
## ⚠️ Platform Differences
180+
181+
- **`isLoading` behavior**
182+
On Android, the `open()` promise resolves immediately after launching Chrome Custom Tabs, so the React hook’s `isLoading` toggles off right away. On iOS we updated `open()` to resolve immediately after presenting SafariViewController (instead of waiting for user dismissal), matching Android behavior.
183+
184+
- **`partialCurl` transition**
185+
The iOS `modalTransitionStyle` value `partialCurl` is only supported when paired with a `fullScreen` presentation. If you specify `partialCurl`, the library now forces `modalPresentationStyle` to `fullScreen` under the hood to prevent UIKit crashes with `overFullScreen`.
186+
179187
## 📖 API Reference
180188

181189
### Core Methods

android/build.gradle

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,24 @@ android {
6565

6666
packagingOptions {
6767
excludes = [
68-
"META-INF",
69-
"META-INF/**",
70-
"**/libc++_shared.so",
71-
"**/libfbjni.so",
72-
"**/libjsi.so",
73-
"**/libfolly_json.so",
74-
"**/libfolly_runtime.so",
75-
"**/libglog.so",
76-
"**/libhermes.so",
77-
"**/libhermes-executor-debug.so",
78-
"**/libhermes_executor.so",
79-
"**/libreactnative.so",
80-
"**/libreactnativejni.so",
81-
"**/libturbomodulejsijni.so",
82-
"**/libreact_nativemodule_core.so",
83-
"**/libjscexecutor.so"
68+
"META-INF",
69+
"META-INF/**",
70+
"**/libc++_shared.so",
71+
"**/libfbjni.so",
72+
"**/libjsi.so",
73+
"**/libfolly_json.so",
74+
"**/libfolly_runtime.so",
75+
"**/libglog.so",
76+
"**/libhermes.so",
77+
"**/libhermes-executor-debug.so",
78+
"**/libhermes_executor.so",
79+
"**/libreactnative.so",
80+
"**/libreactnativejni.so",
81+
"**/libturbomodulejsijni.so",
82+
"**/libreact_nativemodule_core.so",
83+
"**/libjscexecutor.so",
84+
// Exclude duplicate React spec to avoid dex merge errors
85+
"com/facebook/fbreact/specs/NativeAccessibilityInfoSpec.class"
8486
]
8587
}
8688

example/ios/Podfile.lock

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ PODS:
88
- hermes-engine (0.80.1):
99
- hermes-engine/Pre-built (= 0.80.1)
1010
- hermes-engine/Pre-built (0.80.1)
11-
- InAppBrowserNitro (0.1.0):
11+
- InAppBrowserNitro (1.1.0):
1212
- boost
1313
- DoubleConversion
1414
- fast_float
@@ -2427,75 +2427,75 @@ SPEC CHECKSUMS:
24272427
fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd
24282428
glog: 5683914934d5b6e4240e497e0f4a3b42d1854183
24292429
hermes-engine: 4f07404533b808de66cf48ac4200463068d0e95a
2430-
InAppBrowserNitro: f36f1892850ea8532bb2e304c7a45715be350a68
2431-
NitroModules: 1da5740a8e9727a78fdaaa590fdf0d79355343f5
2430+
InAppBrowserNitro: 389395eff84849691f8ef1d9da39468684b4ef72
2431+
NitroModules: 535de81b3e13ddceca0ea79afa8a873c27b31186
24322432
RCT-Folly: 846fda9475e61ec7bcbf8a3fe81edfcaeb090669
24332433
RCTDeprecation: efa5010912100e944a7ac9a93a157e1def1988fe
24342434
RCTRequired: bbc4cf999ddc4a4b076e076c74dd1d39d0254630
24352435
RCTTypeSafety: d877728097547d0a37786cc9130c43ad71739ac3
24362436
React: 4b0b9cb962e694611e5e8a697c1b0300a2510c21
24372437
React-callinvoker: 70f125c17c7132811a6b473946ac5e7ae93b5e57
2438-
React-Core: bab40f5b1f46fe0c5896895a6f333e861a821a81
2439-
React-CoreModules: 05647d952e521113c128360633896ba7ba652e82
2440-
React-cxxreact: 2b4bac1ec6eecc6288ac8a6caea6afb42585740e
2438+
React-Core: 7cbc3118df2334b2ef597d9a515938b02c82109f
2439+
React-CoreModules: 7d8c14ecb889e7786a04637583b55b7d8f246baf
2440+
React-cxxreact: f32be07cba236c2f20f4e05ca200577ba5358e78
24412441
React-debug: deb3a146ef717fa3e8f4c23e0288369fe53199b7
2442-
React-defaultsnativemodule: 11e2948787a15d3cf1b66d7f29f13770a177bff7
2443-
React-domnativemodule: 2f4b279acdb2963736fb5de2f585811dd90070b5
2444-
React-Fabric: 6f8d1a303c96f1d078c14d74c4005bf457e5b782
2445-
React-FabricComponents: b106410970e9a0c4e592da656c7a7e0947306c23
2446-
React-FabricImage: 1abaf230dfce9b58fdf53c4128f3f40c6e64af6a
2447-
React-featureflags: f7ef58d91079efde3ad223bcca6d197e845d5bcf
2448-
React-featureflagsnativemodule: ae5abc9849d1696f4f8f11ee3744bf5715e032cf
2449-
React-graphics: b306856c6ed9aac32f717a229550406a53b28a6d
2450-
React-hermes: b6edce8fa19388654b1aea30844497cbeade83bc
2451-
React-idlecallbacksnativemodule: cb386712842cb9e479c89311edb234d529b64db4
2452-
React-ImageManager: 8ce94417853eaa22faaad1f4cc1952dd3f8e2275
2453-
React-jserrorhandler: ab827d67dc270a9c8703eef524230baeafaf6876
2454-
React-jsi: 545342ec5c78ab1277af5f0dbe8d489e7e73db14
2455-
React-jsiexecutor: 20210891c7c77255c16dec6762faf68b373f9f74
2456-
React-jsinspector: 4e73460e488132d70d2b4894e5578cc856f2cb74
2457-
React-jsinspectorcdp: 8b2bcb5779289cb2b9ca517f2965ed23eb2fd3e0
2458-
React-jsinspectornetwork: b5e0cb9e488d294eed2d8209dc3dc0f9587210c1
2459-
React-jsinspectortracing: f3c4036e7b984405ac910f878576d325dd9f2834
2460-
React-jsitooling: 75bbfd221b6173a5e848ca5a6680506bac064a56
2461-
React-jsitracing: 11ed7d821864dd988c159d4943e0a1e0937c11b1
2462-
React-logger: 984ebd897afad067555d081deaf03f57c4315723
2463-
React-Mapbuffer: 0c045c844ce6d85cde53e85ab163294c6adad349
2464-
React-microtasksnativemodule: d9499269ad1f484ae71319bac1d9231447f2094e
2465-
React-NativeModulesApple: 983f3483ef0a3446b56d490f09d579fba2442e17
2442+
React-defaultsnativemodule: 2c13a4240c5f96c42d069d1ba2392de6b4145bbd
2443+
React-domnativemodule: 91349b0b1cb20310cec1341b87cdd461aaa85e57
2444+
React-Fabric: bdfc7ec2481f26d7a9b8f59461f29ba4d903c549
2445+
React-FabricComponents: 47898469543d1bfb4528a9846419ec5568be89b1
2446+
React-FabricImage: ac8fc85ef452e5e9ae935c41118814651bd9e7f3
2447+
React-featureflags: 793b911e4c53e680db4a7d9965d0d6dc87b2fa88
2448+
React-featureflagsnativemodule: 25c9516d0dd004493c9bbafeb97da20bf9bde7dc
2449+
React-graphics: e07281690425dd9eeba3875d1faad28bc1f6da3b
2450+
React-hermes: bc1440d0e0662cc813bbf1c5ffbf9e0db2993a0f
2451+
React-idlecallbacksnativemodule: a2a3bb4a1793280b34d06d00169153b094be8c16
2452+
React-ImageManager: c9fa7461f3cab08e7bc98cbf55455b499e71c8b3
2453+
React-jserrorhandler: 15e591702040afed99cfcd088cf2337a8d09d807
2454+
React-jsi: 512ab3a1a628bc8824c41de8bcbbb81b2ac6fa8d
2455+
React-jsiexecutor: 653ccd2dee1e5ea558eecaf2f27b8bba0f09add8
2456+
React-jsinspector: 9121ccd2676a3f7c079ac01c9f90183422e3190e
2457+
React-jsinspectorcdp: 5c723ff2a09d73f2fdc496a545fb7003e7fdc079
2458+
React-jsinspectornetwork: 9cb0173f69e8405cef33fc79030fad26bbc3c073
2459+
React-jsinspectortracing: 65dc04125dc2392d85a82b6916f8cb088ea77566
2460+
React-jsitooling: 21af93cc98f760dd88d65b06b9317e0d4849fbbc
2461+
React-jsitracing: 4cc1b7de8087ae41c61a0eeee2593bc3362908b6
2462+
React-logger: 2f0d40bc8e648fbb1ff3b6580ad54189a8753290
2463+
React-Mapbuffer: 9a7c65078c6851397c1999068989e4fc239d0c80
2464+
React-microtasksnativemodule: 4f1ef719ba6c7ebbd2d75346ffa2916f9b4771c9
2465+
React-NativeModulesApple: f6f696e510b9d89c3c06b7764f56947dc13ae922
24662466
React-oscompat: 114036cd8f064558c9c1a0c04fc9ae5e1453706a
2467-
React-perflogger: e7287fee27c16e3c8bd4d470f2361572b63be16b
2468-
React-performancetimeline: 8ebbaa31d2d0cea680b0a2a567500d3cab8954fc
2467+
React-perflogger: 4b2f88ae059b600daf268528a4a83366338eef05
2468+
React-performancetimeline: e15fd9798123436f99e46898422fe921fecf506b
24692469
React-RCTActionSheet: 68c68b0a7a5d2b0cfc255c64889b6e485974e988
2470-
React-RCTAnimation: d6c5c728b888a967ce9aff1ff71a8ed71a68d069
2471-
React-RCTAppDelegate: 0fc048666bda159cd469a6fb9befb04b3fa62be4
2472-
React-RCTBlob: 12d8c699a1f906840113ee8d8bb575e69a05509f
2473-
React-RCTFabric: 01e815845ebc185f44205dcbf50eeb712fec23fe
2474-
React-RCTFBReactNativeSpec: f57927fb0af6ce2f25c19f8b894e2986138aa89f
2475-
React-RCTImage: a82518168f4ee407913b23ca749ca79ef51959f3
2476-
React-RCTLinking: 7f343b584c36f024f390fea563483568fe763ef6
2477-
React-RCTNetwork: 3165eb757ceb62a7cde4cdad043d63314122e8a3
2478-
React-RCTRuntime: feee590c459c4cb6aaa7a00f3abc8c04709b536f
2479-
React-RCTSettings: 6bad0ae45d8d872c873059f332f586f99875621f
2480-
React-RCTText: 657d60f35983062de8f0cea67c279aa7a3ea9858
2481-
React-RCTVibration: 78f4770515141efb7f55f9b27c49dda95319c3a8
2470+
React-RCTAnimation: 6bf502c89c53076f92cd1a254f5ec8d63ee263de
2471+
React-RCTAppDelegate: c90f5732784684c3dd226d812eccb578cd954ad7
2472+
React-RCTBlob: d2905f01749b80efd6d3b86fb15e30ed26d5450b
2473+
React-RCTFabric: 435b3ffaad113fb1f274c2f2a677c9fcc9b5cf55
2474+
React-RCTFBReactNativeSpec: a3178b419f42af196e90ca4bf07710dce5d68301
2475+
React-RCTImage: 8f5ffa03461339180a68820ea452af6e20ace2c7
2476+
React-RCTLinking: 1151646834d31f97580d8a75d768a84b2533b7f9
2477+
React-RCTNetwork: 52008724d0db90a540f4058ed0de0e41c4b7943c
2478+
React-RCTRuntime: 10ce9a7cb27ba307544d29a2a04e6202dc7b3e9a
2479+
React-RCTSettings: f724cacbd892ee18f985e1aebdd97386e49c76f5
2480+
React-RCTText: 6e1b95d9126d808410dfa96e09bc4441ec6f36f7
2481+
React-RCTVibration: 862a4e5b36d49e6299c8cbfb86486fc31f86f6fa
24822482
React-rendererconsistency: f7baab26c6d0cd5b2eb7afcecfd2d8b957017b18
2483-
React-renderercss: bdd2f83a4a054c3e4321fd61305c202b848e471b
2484-
React-rendererdebug: 9f8865ee038127a9d99d4b034c9da4935d204993
2483+
React-renderercss: 62acb8f010a062309e3bd0e203aa14636162e3b3
2484+
React-rendererdebug: 3a89ac44f15c7160735264d585a29525655238d2
24852485
React-rncore: f7438473c4c71ee1963fb06a8635bb96013c9e1c
2486-
React-RuntimeApple: 4d2ab9f72b9193da86eceded128a67254fc18aeb
2487-
React-RuntimeCore: 5fd73030438d094975ca0f549d162dd97746ae38
2486+
React-RuntimeApple: 81f0a9ba81ce7eb203529b0471dc69bf18f5f637
2487+
React-RuntimeCore: 6356e89b2518ba66a989c39a2adb18122a5e3b7b
24882488
React-runtimeexecutor: 17c70842d5e611130cb66f91e247bc4a609c3508
2489-
React-RuntimeHermes: 3c88e6e1ea7ea0899dcffc77c10d61ea46688cfd
2490-
React-runtimescheduler: 024500621c7c93d65371498abb4ee26d34f5d47d
2489+
React-RuntimeHermes: 0a1d7ce2fe08cf182235de1a9330b51aa6b935cd
2490+
React-runtimescheduler: 10ae98e1417eff159be5df8fdc8fcdaac557aba6
24912491
React-timing: c3c923df2b86194e1682e01167717481232f1dc7
2492-
React-utils: 9154a037543147e1c24098f1a48fc8472602c092
2493-
ReactAppDependencyProvider: afd905e84ee36e1678016ae04d7370c75ed539be
2494-
ReactCodegen: f8d5fb047c4cd9d2caade972cad9edac22521362
2495-
ReactCommon: 17fd88849a174bf9ce45461912291aca711410fc
2492+
React-utils: 7791a96e194eec85cb41dc98a2045b5f07839598
2493+
ReactAppDependencyProvider: ba631a31783569c13056dd57ff39e19764abdd6f
2494+
ReactCodegen: b16d00d43b4e9dc44af53be171b17d93b4b20267
2495+
ReactCommon: 96684b90b235d6ae340d126141edd4563b7a446a
24962496
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
2497-
Yoga: daa1e4de4b971b977b23bc842aaa3e135324f1f3
2497+
Yoga: 703055a9f39562521cdb8657162dfd80f8c174c3
24982498

24992499
PODFILE CHECKSUM: 2913578fb3d8fa086d6533dc28567fc2f28aa821
25002500

2501-
COCOAPODS: 1.16.2
2501+
COCOAPODS: 1.15.2

ios/InAppBrowserNitro.swift

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,28 +77,27 @@ public class InAppBrowserNitroImpl: HybridInAppBrowserNitroSpec {
7777
}
7878
}
7979

80-
if let modalPresentationStyle = options?.modalPresentationStyle {
81-
safariViewController?.modalPresentationStyle = getPresentationStyle(from: modalPresentationStyle)
80+
// Handle presentation and transition styles, ensuring partialCurl uses fullScreen
81+
if let transitionStyle = options?.modalTransitionStyle, transitionStyle == .partialCurl {
82+
safariViewController?.modalPresentationStyle = .fullScreen
83+
} else if let presentationStyle = options?.modalPresentationStyle {
84+
safariViewController?.modalPresentationStyle = getPresentationStyle(from: presentationStyle)
8285
}
83-
84-
if let modalTransitionStyle = options?.modalTransitionStyle {
85-
safariViewController?.modalTransitionStyle = getTransitionStyle(from: modalTransitionStyle)
86+
if let transitionStyle = options?.modalTransitionStyle {
87+
safariViewController?.modalTransitionStyle = getTransitionStyle(from: transitionStyle)
8688
}
8789

8890
guard let presentingViewController = getRootViewController() else {
8991
return InAppBrowserResult(type: .dismiss, url: nil, message: "No presenting view controller found")
9092
}
9193

92-
return await withCheckedContinuation { continuation in
93-
let delegate = SafariViewControllerDelegate { result in
94-
continuation.resume(returning: result)
95-
}
96-
97-
safariViewController?.delegate = delegate
98-
99-
let animated = options?.animated ?? true
100-
presentingViewController.present(safariViewController!, animated: animated, completion: nil)
101-
}
94+
// Present the in-app browser and return immediately
95+
let animated = options?.animated ?? true
96+
97+
presentingViewController.present(safariViewController!, animated: animated, completion: nil)
98+
99+
// Immediately resolve as success; dismissal events can be handled via close()
100+
return InAppBrowserResult(type: .success, url: nil, message: nil)
102101
}
103102

104103
@MainActor

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
"version": "1.1.0",
44
"description": "🚀 Lightning-fast in-app browser for React Native powered by Nitro Modules. Direct JSI bindings for native performance with Safari View Controller (iOS) & Chrome Custom Tabs (Android). Zero bridge overhead, TypeScript-first, with React hooks support.",
55
"main": "./lib/module/index.js",
6+
"react-native": "./lib/module/index.js",
67
"types": "./lib/typescript/src/index.d.ts",
78
"exports": {
89
".": {
10+
"react-native": "./lib/module/index.js",
911
"source": "./src/index.tsx",
1012
"types": "./lib/typescript/src/index.d.ts",
1113
"default": "./lib/module/index.js"
@@ -40,6 +42,8 @@
4042
"lint": "eslint \"**/*.{js,ts,tsx}\"",
4143
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
4244
"prepare": "bob build",
45+
"postinstall": "bob build",
46+
"prepublishOnly": "bob build",
4347
"nitrogen": "nitro-codegen",
4448
"release": "release-it --only-version"
4549
},

0 commit comments

Comments
 (0)