-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/updates andi os26 support #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reorganized Android and iOS source directories, updated package and configuration files, and replaced legacy GitHub Actions workflows with new, more focused build and release workflows. Removed old configuration, template, and lock files, and migrated Android and iOS package code to new namespaces. Added new example app setup and updated build scripts for improved maintainability.
Introduces a new in-app browser module with native Android (Custom Tabs) and iOS (Safari Services) implementations, including imperative and React hook APIs. Adds option normalization, URL validation, and dynamic color support. Updates TypeScript specs and exports for a unified cross-platform interface.
Major overhaul of the example App.tsx to showcase new Nitro module features, dynamic color palettes, and authentication flows. The README.md is rewritten for clarity, highlighting new APIs, migration notes, and platform-specific options. iOS project files are updated for Hermes, new architecture, and privacy compliance. Dependency lock files and workspace data are added for reproducibility.
Eliminates the warmup API, implementation, and documentation for both Android and iOS. Removes related code, hooks, and references, including the CustomTabsConnection and BrowserWarmupCoordinator classes. Updates the README and example app to reflect the removal of warmup, focusing on streamlined browser session management and improved code clarity.
- Add <queries> to android/src/main/AndroidManifest.xml to declare VIEW intents (http/https), the CustomTabs service action and common browser packages - Add demo app.gif to the repo - Reformat example AndroidManifest and example iOS Info.plist (whitespace/ordering only)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR represents a comprehensive rewrite and restructuring of the react-native-inappbrowser-nitro library to support iOS 26 and Android 16 features while modernizing the codebase architecture.
- Complete migration from existing architecture to Nitro Modules with enhanced TypeScript bindings
- Addition of iOS 26 features including high-contrast dynamic colors, edge-dismiss control, and UI style overrides
- Implementation of Android 16 capabilities like partial custom tabs, referrer controls, and per-theme color palettes
Reviewed Changes
Copilot reviewed 91 out of 101 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/specs/inappbrowser-nitro.nitro.ts | New Nitro module specification with comprehensive type definitions and iOS 26/Android 16 feature support |
| src/core/InAppBrowser.ts | Redesigned imperative API with URL/options validation and improved error handling |
| src/utils/options.ts | New utility for sanitizing and normalizing cross-platform browser options |
| src/utils/url.ts | URL validation and security filtering utilities |
| src/hooks/useInAppBrowser.ts | Updated React hook with improved async handling and component lifecycle management |
| ios/HybridInappbrowserNitro.swift | New iOS implementation leveraging Safari View Controller with iOS 26 features |
| android/src/main/java/com/inappbrowsernitro/HybridInappbrowserNitro.kt | New Android implementation using Custom Tabs with Android 16 enhancements |
Files not reviewed (1)
- example/ios/InappbrowserNitroExample.xcworkspace/contents.xcworkspacedata: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| @@ -0,0 +1,24 @@ | |||
| /** | |||
Copilot
AI
Oct 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing JSDoc description for the main script purpose. Consider adding a brief explanation of what this workaround accomplishes for Android builds.
| /** | |
| /** | |
| * Workaround script to enable custom package names for Android builds. |
|
|
||
| internal object DynamicColorResolver { | ||
| fun resolve(context: Context, dynamicColor: DynamicColor?): Int? { | ||
| dynamicColor ?: return null | ||
|
|
||
| val accessibilityManager = context.getSystemService<AccessibilityManager>() | ||
| val isHighContrast = accessibilityManager?.let { manager -> | ||
| runCatching { | ||
| val method = AccessibilityManager::class.java.getMethod("isHighTextContrastEnabled") | ||
| (method.invoke(manager) as? Boolean) == true | ||
| }.getOrDefault(false) | ||
| } == true |
Copilot
AI
Oct 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reflection-based approach to access high contrast settings introduces fragility. Consider adding API level checks or using a more robust detection method to avoid potential crashes on different Android versions.
| internal object DynamicColorResolver { | |
| fun resolve(context: Context, dynamicColor: DynamicColor?): Int? { | |
| dynamicColor ?: return null | |
| val accessibilityManager = context.getSystemService<AccessibilityManager>() | |
| val isHighContrast = accessibilityManager?.let { manager -> | |
| runCatching { | |
| val method = AccessibilityManager::class.java.getMethod("isHighTextContrastEnabled") | |
| (method.invoke(manager) as? Boolean) == true | |
| }.getOrDefault(false) | |
| } == true | |
| import android.os.Build | |
| internal object DynamicColorResolver { | |
| fun resolve(context: Context, dynamicColor: DynamicColor?): Int? { | |
| dynamicColor ?: return null | |
| val accessibilityManager = context.getSystemService<AccessibilityManager>() | |
| val isHighContrast = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | |
| accessibilityManager?.isHighTextContrastEnabled == true | |
| } else { | |
| false | |
| } |
| options?.instantAppsEnabled?.let(builder::setInstantAppsEnabled) | ||
|
|
||
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && options?.enablePartialCustomTab == true) { | ||
| val height = (context.resources.displayMetrics.heightPixels * PARTIAL_TAB_RATIO).toInt() |
Copilot
AI
Oct 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magic number PARTIAL_TAB_RATIO (0.85f) should be documented or made configurable. Consider adding a comment explaining why 85% was chosen as the default partial tab height.
|
|
||
| if let transition = options?.modalTransitionStyle { | ||
| controller.modalTransitionStyle = SafariStyleMapper.transitionStyle(from: transition) | ||
| if transition == .partialcurl { |
Copilot
AI
Oct 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded override for partialCurl transition style should include a comment explaining why fullScreen is required to prevent UIKit crashes, as mentioned in platform differences documentation.
| if transition == .partialcurl { | |
| if transition == .partialcurl { | |
| // UIKit requires .fullScreen presentation style when using .partialCurl transition to prevent crashes. | |
| // See: https://developer.apple.com/documentation/uikit/uiviewcontroller/1621355-modaltransitionstyle |
No description provided.