Skip to content

Conversation

@mCodex
Copy link
Owner

@mCodex mCodex commented Oct 13, 2025

No description provided.

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)
Copilot AI review requested due to automatic review settings October 13, 2025 20:00
Copy link

Copilot AI left a 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 @@
/**
Copy link

Copilot AI Oct 13, 2025

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.

Suggested change
/**
/**
* Workaround script to enable custom package names for Android builds.

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +19

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
Copy link

Copilot AI Oct 13, 2025

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.

Suggested change
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
}

Copilot uses AI. Check for mistakes.
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()
Copy link

Copilot AI Oct 13, 2025

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.

Copilot uses AI. Check for mistakes.

if let transition = options?.modalTransitionStyle {
controller.modalTransitionStyle = SafariStyleMapper.transitionStyle(from: transition)
if transition == .partialcurl {
Copy link

Copilot AI Oct 13, 2025

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
@mCodex mCodex merged commit 096156f into main Oct 13, 2025
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants