You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrating from earlier `react-native-inappbrowser-nitro` versions? Note these key changes when adopting the Nitro rewrite:
146
148
149
+
### Migrating to v3 (named exports)
150
+
151
+
The `InAppBrowser` static class has been replaced with individual named exports for better tree shaking. Update your imports:
152
+
153
+
```diff
154
+
-import { InAppBrowser } from 'react-native-inappbrowser-nitro'
155
+
+import { open, openAuth, close, closeAuth, isAvailable } from 'react-native-inappbrowser-nitro'
156
+
157
+
-InAppBrowser.open(url, options)
158
+
+open(url, options)
159
+
160
+
-InAppBrowser.openAuth(url, redirectUrl, options)
161
+
+openAuth(url, redirectUrl, options)
162
+
163
+
-InAppBrowser.close()
164
+
+close()
165
+
166
+
-InAppBrowser.closeAuth()
167
+
+closeAuth()
168
+
169
+
-InAppBrowser.isAvailable()
170
+
+isAvailable()
171
+
```
172
+
173
+
The hook import is unchanged: `import { useInAppBrowser } from 'react-native-inappbrowser-nitro'`
174
+
175
+
---
176
+
147
177
### 1. `open()` resolves on presentation
148
178
149
179
Older releases resolved the promise when the browser closed. The new implementation resolves as soon as Safari/Custom Tabs is shown (mirroring Android behavior), and dismissal status is delivered asynchronously.
@@ -194,7 +224,7 @@ Run `yarn codegen && yarn build` (or your project script) to regenerate Nitro bi
194
224
|`close()`| Programmatically dismiss an open browser session. |
195
225
|`closeAuth()`| Abort an authentication session. |
196
226
197
-
All functions return Promises and are fully typed. See `src/core/InAppBrowser.ts` for the higher-level wrapper implementation.
227
+
All functions return Promises and are fully typed. See `src/core/native.ts` for the native module wrapper implementation.
val isDark = (context.resources.configuration.uiMode and android.content.res.Configuration.UI_MODE_NIGHT_MASK) == android.content.res.Configuration.UI_MODE_NIGHT_YES
21
+
val isDark = (context.resources.configuration.uiMode and
0 commit comments