├── .watchmanconfig ├── example ├── .watchmanconfig ├── jest.config.js ├── .bundle │ └── config ├── .eslintrc.js ├── app.json ├── .prettierrc.js ├── android │ ├── app │ │ ├── debug.keystore │ │ ├── src │ │ │ ├── main │ │ │ │ ├── res │ │ │ │ │ ├── values │ │ │ │ │ │ ├── strings.xml │ │ │ │ │ │ └── styles.xml │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ └── drawable │ │ │ │ │ │ └── rn_edit_text_material.xml │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── nitroinappbrowserexample │ │ │ │ │ │ ├── MainActivity.kt │ │ │ │ │ │ └── MainApplication.kt │ │ │ │ └── AndroidManifest.xml │ │ │ └── debug │ │ │ │ └── AndroidManifest.xml │ │ ├── proguard-rules.pro │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── settings.gradle │ ├── build.gradle │ ├── gradle.properties │ ├── gradlew.bat │ └── gradlew ├── ios │ ├── NitroInAppBrowserExample │ │ ├── Images.xcassets │ │ │ ├── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── PrivacyInfo.xcprivacy │ │ ├── AppDelegate.swift │ │ ├── Info.plist │ │ └── LaunchScreen.storyboard │ ├── NitroInAppBrowserExample.xcworkspace │ │ └── contents.xcworkspacedata │ ├── .xcode.env │ ├── Podfile │ └── NitroInAppBrowserExample.xcodeproj │ │ └── xcshareddata │ │ └── xcschemes │ │ └── NitroInAppBrowserExample.xcscheme ├── index.js ├── tsconfig.json ├── react-native.config.js ├── metro.config.js ├── babel.config.js ├── Gemfile ├── App.tsx ├── package.json ├── .gitignore ├── Gemfile.lock └── README.md ├── nitrogen └── generated │ ├── .gitattributes │ ├── ios │ ├── c++ │ │ ├── HybridNitroInAppBrowserSpecSwift.cpp │ │ └── HybridNitroInAppBrowserSpecSwift.hpp │ ├── NitroInAppBrowserAutolinking.mm │ ├── NitroInAppBrowserAutolinking.swift │ ├── swift │ │ ├── NitroInAppBrowserDismissButtonLabel.swift │ │ ├── NitroInAppBrowserPresentationStyle.swift │ │ ├── Func_void.swift │ │ ├── Func_void_std__exception_ptr.swift │ │ ├── HybridNitroInAppBrowserSpec.swift │ │ ├── NitroInAppBrowserOptions.swift │ │ └── HybridNitroInAppBrowserSpec_cxx.swift │ ├── NitroInAppBrowser+autolinking.rb │ ├── NitroInAppBrowser-Swift-Cxx-Bridge.cpp │ ├── NitroInAppBrowser-Swift-Cxx-Umbrella.hpp │ └── NitroInAppBrowser-Swift-Cxx-Bridge.hpp │ ├── android │ ├── kotlin │ │ └── com │ │ │ └── margelo │ │ │ └── nitro │ │ │ └── nitroinappbrowser │ │ │ ├── NitroInAppBrowserDismissButtonLabel.kt │ │ │ ├── NitroInAppBrowserPresentationStyle.kt │ │ │ ├── NitroInAppBrowserOptions.kt │ │ │ ├── NitroInAppBrowserOnLoad.kt │ │ │ └── HybridNitroInAppBrowserSpec.kt │ ├── NitroInAppBrowser+autolinking.gradle │ ├── NitroInAppBrowserOnLoad.hpp │ ├── NitroInAppBrowserOnLoad.cpp │ ├── c++ │ │ ├── JHybridNitroInAppBrowserSpec.hpp │ │ ├── JNitroInAppBrowserDismissButtonLabel.hpp │ │ ├── JNitroInAppBrowserPresentationStyle.hpp │ │ ├── JNitroInAppBrowserOptions.hpp │ │ └── JHybridNitroInAppBrowserSpec.cpp │ └── NitroInAppBrowser+autolinking.cmake │ └── shared │ └── c++ │ ├── HybridNitroInAppBrowserSpec.cpp │ ├── HybridNitroInAppBrowserSpec.hpp │ ├── NitroInAppBrowserDismissButtonLabel.hpp │ ├── NitroInAppBrowserPresentationStyle.hpp │ └── NitroInAppBrowserOptions.hpp ├── babel.config.js ├── android ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ ├── cpp │ │ └── cpp-adapter.cpp │ │ └── java │ │ └── com │ │ └── nitroinappbrowser │ │ ├── HybridNitroInAppBrowser.kt │ │ ├── NitroInAppBrowserPackage.java │ │ └── NitroInAppBrowserImpl.kt ├── gradle.properties ├── CMakeLists.txt └── build.gradle ├── ios ├── Bridge.h ├── HybridNitroInAppBrowser.swift ├── BrowserConfiguration.swift ├── SafariBrowserPresenter.swift └── NitroBrowserColor.swift ├── src ├── specs │ └── nitro-in-app-browser.nitro.ts ├── types.ts └── index.ts ├── nitro.json ├── post-script.js ├── tsconfig.json ├── .gitignore ├── LICENSE ├── .github ├── dependabot.yml └── workflows │ ├── release.yml │ ├── android-build.yml │ └── ios-build.yml ├── NitroInAppBrowser.podspec ├── release.config.js ├── README.md ├── CHANGELOG.md └── package.json /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /nitrogen/generated/.gitattributes: -------------------------------------------------------------------------------- 1 | ** linguist-generated=true 2 | -------------------------------------------------------------------------------- /example/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'react-native', 3 | }; 4 | -------------------------------------------------------------------------------- /example/.bundle/config: -------------------------------------------------------------------------------- 1 | BUNDLE_PATH: "vendor/bundle" 2 | BUNDLE_FORCE_RUBY_PLATFORM: 1 3 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:@react-native/babel-preset'], 3 | } 4 | -------------------------------------------------------------------------------- /example/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native', 4 | }; 5 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "NitroInAppBrowserExample", 3 | "displayName": "NitroInAppBrowserExample" 4 | } 5 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /example/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | arrowParens: 'avoid', 3 | singleQuote: true, 4 | trailingComma: 'all', 5 | }; 6 | -------------------------------------------------------------------------------- /ios/Bridge.h: -------------------------------------------------------------------------------- 1 | // 2 | // Bridge.h 3 | // nitro-in-app-browser 4 | // 5 | // Created by Patrick Kabwe on 5/16/2025 6 | // 7 | 8 | #pragma once 9 | -------------------------------------------------------------------------------- /example/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickkabwe/react-native-nitro-in-app-browser/HEAD/example/android/app/debug.keystore -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | NitroInAppBrowserExample 3 | 4 | -------------------------------------------------------------------------------- /example/ios/NitroInAppBrowserExample/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickkabwe/react-native-nitro-in-app-browser/HEAD/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickkabwe/react-native-nitro-in-app-browser/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickkabwe/react-native-nitro-in-app-browser/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickkabwe/react-native-nitro-in-app-browser/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickkabwe/react-native-nitro-in-app-browser/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickkabwe/react-native-nitro-in-app-browser/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickkabwe/react-native-nitro-in-app-browser/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickkabwe/react-native-nitro-in-app-browser/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickkabwe/react-native-nitro-in-app-browser/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickkabwe/react-native-nitro-in-app-browser/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickkabwe/react-native-nitro-in-app-browser/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/src/main/cpp/cpp-adapter.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "NitroInAppBrowserOnLoad.hpp" 3 | 4 | JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { 5 | return margelo::nitro::nitroinappbrowser::initialize(vm); 6 | } 7 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | NitroInAppBrowser_kotlinVersion=2.0.21 2 | NitroInAppBrowser_minSdkVersion=23 3 | NitroInAppBrowser_targetSdkVersion=34 4 | NitroInAppBrowser_compileSdkVersion=34 5 | NitroInAppBrowser_ndkVersion=27.1.12297006 6 | -------------------------------------------------------------------------------- /example/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import {AppRegistry} from 'react-native'; 6 | import App from './App'; 7 | import {name as appName} from './app.json'; 8 | 9 | AppRegistry.registerComponent(appName, () => App); 10 | -------------------------------------------------------------------------------- /example/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@react-native/typescript-config/tsconfig.json", 3 | "compilerOptions": { 4 | "strict": true, 5 | "baseUrl": ".", 6 | "paths": { 7 | "react-native-nitro-in-app-browser": ["../src"] 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /example/ios/NitroInAppBrowserExample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/specs/nitro-in-app-browser.nitro.ts: -------------------------------------------------------------------------------- 1 | import { type HybridObject } from 'react-native-nitro-modules'; 2 | import type { NitroInAppBrowserOptions } from '../types'; 3 | export interface NitroInAppBrowser 4 | extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> { 5 | open(url: string, options?: NitroInAppBrowserOptions): Promise 6 | close(): Promise 7 | } 8 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { includeBuild("../../node_modules/@react-native/gradle-plugin") } 2 | plugins { id("com.facebook.react.settings") } 3 | extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() } 4 | rootProject.name = 'NitroInAppBrowserExample' 5 | include ':app' 6 | includeBuild('../../node_modules/@react-native/gradle-plugin') 7 | -------------------------------------------------------------------------------- /example/react-native.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const pkg = require('../package.json') 3 | 4 | /** 5 | * @type {import('@react-native-community/cli-types').Config} 6 | */ 7 | module.exports = { 8 | project: { 9 | ios: { 10 | automaticPodsInstallation: true, 11 | }, 12 | }, 13 | dependencies: { 14 | [pkg.name]: { 15 | root: path.join(__dirname, '..'), 16 | }, 17 | }, 18 | } 19 | -------------------------------------------------------------------------------- /src/types.ts: -------------------------------------------------------------------------------- 1 | export type NitroInAppBrowserDismissButtonLabel = 'cancel' | 'done' | 'close' 2 | 3 | export type NitroInAppBrowserPresentationStyle = 'pageSheet' | 'formSheet' | 'fullScreen' 4 | 5 | export interface NitroInAppBrowserOptions { 6 | dismissButtonLabel?: NitroInAppBrowserDismissButtonLabel 7 | presentationStyle?: NitroInAppBrowserPresentationStyle 8 | barColor?: string 9 | controlColor?: string 10 | } 11 | -------------------------------------------------------------------------------- /nitrogen/generated/ios/c++/HybridNitroInAppBrowserSpecSwift.cpp: -------------------------------------------------------------------------------- 1 | /// 2 | /// HybridNitroInAppBrowserSpecSwift.cpp 3 | /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. 4 | /// https://github.com/mrousavy/nitro 5 | /// Copyright © 2025 Marc Rousavy @ Margelo 6 | /// 7 | 8 | #include "HybridNitroInAppBrowserSpecSwift.hpp" 9 | 10 | namespace margelo::nitro::nitroinappbrowser { 11 | } // namespace margelo::nitro::nitroinappbrowser 12 | -------------------------------------------------------------------------------- /example/metro.config.js: -------------------------------------------------------------------------------- 1 | const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config'); 2 | const path = require('path'); 3 | const root = path.resolve(__dirname, '..'); 4 | 5 | /** 6 | * Metro configuration 7 | * https://facebook.github.io/metro/docs/configuration 8 | * 9 | * @type {import('metro-config').MetroConfig} 10 | */ 11 | const config = { 12 | watchFolders: [root], 13 | }; 14 | 15 | module.exports = mergeConfig(getDefaultConfig(__dirname), config); -------------------------------------------------------------------------------- /example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /example/babel.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const pak = require('../package.json'); 3 | 4 | module.exports = api => { 5 | api.cache(true); 6 | return { 7 | presets: ['module:@react-native/babel-preset'], 8 | plugins: [ 9 | [ 10 | 'module-resolver', 11 | { 12 | extensions: ['.js', '.ts', '.json', '.jsx', '.tsx'], 13 | alias: { 14 | [pak.name]: path.join(__dirname, '../', pak.source), 15 | }, 16 | }, 17 | ], 18 | ], 19 | }; 20 | }; -------------------------------------------------------------------------------- /example/ios/.xcode.env: -------------------------------------------------------------------------------- 1 | # This `.xcode.env` file is versioned and is used to source the environment 2 | # used when running script phases inside Xcode. 3 | # To customize your local environment, you can create an `.xcode.env.local` 4 | # file that is not versioned. 5 | 6 | # NODE_BINARY variable contains the PATH to the node executable. 7 | # 8 | # Customize the NODE_BINARY variable here. 9 | # For example, to use nvm with brew, add the following line 10 | # . "$(brew --prefix nvm)/nvm.sh" --no-use 11 | export NODE_BINARY=$(command -v node) 12 | -------------------------------------------------------------------------------- /example/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version 4 | ruby ">= 2.6.10" 5 | 6 | # Exclude problematic versions of cocoapods and activesupport that causes build failures. 7 | gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1' 8 | gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0' 9 | gem 'xcodeproj', '< 1.28.0' 10 | gem 'concurrent-ruby', '< 1.3.6' 11 | 12 | # Ruby 3.4.0 has removed some libraries from the standard library. 13 | gem 'bigdecimal' 14 | gem 'logger' 15 | gem 'benchmark' 16 | gem 'mutex_m' 17 | -------------------------------------------------------------------------------- /nitro.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://nitro.margelo.com/nitro.schema.json", 3 | "cxxNamespace": [ 4 | "nitroinappbrowser" 5 | ], 6 | "ios": { 7 | "iosModuleName": "NitroInAppBrowser" 8 | }, 9 | "android": { 10 | "androidNamespace": [ 11 | "nitroinappbrowser" 12 | ], 13 | "androidCxxLibName": "NitroInAppBrowser" 14 | }, 15 | "autolinking": { 16 | "NitroInAppBrowser": { 17 | "swift": "HybridNitroInAppBrowser", 18 | "kotlin": "HybridNitroInAppBrowser" 19 | } 20 | }, 21 | "ignorePaths": [ 22 | "**/node_modules" 23 | ] 24 | } -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | buildToolsVersion = "36.0.0" 4 | minSdkVersion = 24 5 | compileSdkVersion = 36 6 | targetSdkVersion = 36 7 | ndkVersion = "27.1.12297006" 8 | kotlinVersion = "2.1.20" 9 | } 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | dependencies { 15 | classpath("com.android.tools.build:gradle") 16 | classpath("com.facebook.react:react-native-gradle-plugin") 17 | classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") 18 | } 19 | } 20 | 21 | apply plugin: "com.facebook.react.rootproject" 22 | -------------------------------------------------------------------------------- /nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinappbrowser/NitroInAppBrowserDismissButtonLabel.kt: -------------------------------------------------------------------------------- 1 | /// 2 | /// NitroInAppBrowserDismissButtonLabel.kt 3 | /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. 4 | /// https://github.com/mrousavy/nitro 5 | /// Copyright © 2025 Marc Rousavy @ Margelo 6 | /// 7 | 8 | package com.margelo.nitro.nitroinappbrowser 9 | 10 | import androidx.annotation.Keep 11 | import com.facebook.proguard.annotations.DoNotStrip 12 | 13 | /** 14 | * Represents the JavaScript enum/union "NitroInAppBrowserDismissButtonLabel". 15 | */ 16 | @DoNotStrip 17 | @Keep 18 | enum class NitroInAppBrowserDismissButtonLabel(@DoNotStrip @Keep val value: Int) { 19 | CANCEL(0), 20 | DONE(1), 21 | CLOSE(2); 22 | } 23 | -------------------------------------------------------------------------------- /nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinappbrowser/NitroInAppBrowserPresentationStyle.kt: -------------------------------------------------------------------------------- 1 | /// 2 | /// NitroInAppBrowserPresentationStyle.kt 3 | /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. 4 | /// https://github.com/mrousavy/nitro 5 | /// Copyright © 2025 Marc Rousavy @ Margelo 6 | /// 7 | 8 | package com.margelo.nitro.nitroinappbrowser 9 | 10 | import androidx.annotation.Keep 11 | import com.facebook.proguard.annotations.DoNotStrip 12 | 13 | /** 14 | * Represents the JavaScript enum/union "NitroInAppBrowserPresentationStyle". 15 | */ 16 | @DoNotStrip 17 | @Keep 18 | enum class NitroInAppBrowserPresentationStyle(@DoNotStrip @Keep val value: Int) { 19 | PAGESHEET(0), 20 | FORMSHEET(1), 21 | FULLSCREEN(2); 22 | } 23 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { NitroModules } from 'react-native-nitro-modules' 2 | import type { NitroInAppBrowser as NitroInAppBrowserSpec } from './specs/nitro-in-app-browser.nitro' 3 | import type { NitroInAppBrowserOptions, NitroInAppBrowserPresentationStyle } from "./types" 4 | export * from "./types" 5 | 6 | const NitroInAppBrowserModule = 7 | NitroModules.createHybridObject('NitroInAppBrowser') 8 | 9 | const NitroInAppBrowser = { 10 | open: (url: string, options?: Omit & { 11 | presentationStyle?: NitroInAppBrowserPresentationStyle 12 | }) => 13 | NitroInAppBrowserModule.open(url, options), 14 | close: () => NitroInAppBrowserModule.close(), 15 | } 16 | 17 | export default NitroInAppBrowser -------------------------------------------------------------------------------- /android/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(NitroInAppBrowser) 2 | cmake_minimum_required(VERSION 3.9.0) 3 | 4 | set (PACKAGE_NAME NitroInAppBrowser) 5 | set (CMAKE_VERBOSE_MAKEFILE ON) 6 | set (CMAKE_CXX_STANDARD 20) 7 | 8 | # Define C++ library and add all sources 9 | add_library(${PACKAGE_NAME} SHARED 10 | src/main/cpp/cpp-adapter.cpp 11 | ) 12 | 13 | # Add Nitrogen specs :) 14 | include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/NitroInAppBrowser+autolinking.cmake) 15 | 16 | # Set up local includes 17 | include_directories( 18 | "src/main/cpp" 19 | "../cpp" 20 | ) 21 | 22 | find_library(LOG_LIB log) 23 | 24 | # Link all libraries together 25 | target_link_libraries( 26 | ${PACKAGE_NAME} 27 | ${LOG_LIB} 28 | android # <-- Android core 29 | ) 30 | -------------------------------------------------------------------------------- /nitrogen/generated/android/NitroInAppBrowser+autolinking.gradle: -------------------------------------------------------------------------------- 1 | /// 2 | /// NitroInAppBrowser+autolinking.gradle 3 | /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. 4 | /// https://github.com/mrousavy/nitro 5 | /// Copyright © 2025 Marc Rousavy @ Margelo 6 | /// 7 | 8 | /// This is a Gradle file that adds all files generated by Nitrogen 9 | /// to the current Gradle project. 10 | /// 11 | /// To use it, add this to your build.gradle: 12 | /// ```gradle 13 | /// apply from: '../nitrogen/generated/android/NitroInAppBrowser+autolinking.gradle' 14 | /// ``` 15 | 16 | logger.warn("[NitroModules] 🔥 NitroInAppBrowser is boosted by nitro!") 17 | 18 | android { 19 | sourceSets { 20 | main { 21 | java.srcDirs += [ 22 | // Nitrogen files 23 | "${project.projectDir}/../nitrogen/generated/android/kotlin" 24 | ] 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /nitrogen/generated/shared/c++/HybridNitroInAppBrowserSpec.cpp: -------------------------------------------------------------------------------- 1 | /// 2 | /// HybridNitroInAppBrowserSpec.cpp 3 | /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. 4 | /// https://github.com/mrousavy/nitro 5 | /// Copyright © 2025 Marc Rousavy @ Margelo 6 | /// 7 | 8 | #include "HybridNitroInAppBrowserSpec.hpp" 9 | 10 | namespace margelo::nitro::nitroinappbrowser { 11 | 12 | void HybridNitroInAppBrowserSpec::loadHybridMethods() { 13 | // load base methods/properties 14 | HybridObject::loadHybridMethods(); 15 | // load custom methods/properties 16 | registerHybrids(this, [](Prototype& prototype) { 17 | prototype.registerHybridMethod("open", &HybridNitroInAppBrowserSpec::open); 18 | prototype.registerHybridMethod("close", &HybridNitroInAppBrowserSpec::close); 19 | }); 20 | } 21 | 22 | } // namespace margelo::nitro::nitroinappbrowser 23 | -------------------------------------------------------------------------------- /post-script.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file This script is auto-generated by create-nitro-module and should not be edited. 3 | * 4 | * @description This script applies a workaround for Android by modifying the 'OnLoad.cpp' file. 5 | * It reads the file content and removes the 'margelo/nitro/' string from it. This enables support for custom package names. 6 | * 7 | * @module create-nitro-module 8 | */ 9 | const path = require('node:path') 10 | const { writeFile, readFile } = require('node:fs/promises') 11 | 12 | const androidWorkaround = async () => { 13 | const androidOnLoadFile = path.join( 14 | process.cwd(), 15 | 'nitrogen/generated/android', 16 | 'NitroInAppBrowserOnLoad.cpp' 17 | ) 18 | 19 | 20 | const str = await readFile(androidOnLoadFile, { encoding: 'utf8' }) 21 | await writeFile(androidOnLoadFile, str.replace(/margelo\/nitro\//g, '')) 22 | } 23 | androidWorkaround() -------------------------------------------------------------------------------- /nitrogen/generated/android/NitroInAppBrowserOnLoad.hpp: -------------------------------------------------------------------------------- 1 | /// 2 | /// NitroInAppBrowserOnLoad.hpp 3 | /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. 4 | /// https://github.com/mrousavy/nitro 5 | /// Copyright © 2025 Marc Rousavy @ Margelo 6 | /// 7 | 8 | #include 9 | #include 10 | 11 | namespace margelo::nitro::nitroinappbrowser { 12 | 13 | /** 14 | * Initializes the native (C++) part of NitroInAppBrowser, and autolinks all Hybrid Objects. 15 | * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`). 16 | * Example: 17 | * ```cpp (cpp-adapter.cpp) 18 | * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { 19 | * return margelo::nitro::nitroinappbrowser::initialize(vm); 20 | * } 21 | * ``` 22 | */ 23 | int initialize(JavaVM* vm); 24 | 25 | } // namespace margelo::nitro::nitroinappbrowser 26 | -------------------------------------------------------------------------------- /android/src/main/java/com/nitroinappbrowser/HybridNitroInAppBrowser.kt: -------------------------------------------------------------------------------- 1 | package com.nitroinappbrowser 2 | 3 | import com.margelo.nitro.NitroModules 4 | import com.margelo.nitro.core.Promise 5 | import com.margelo.nitro.nitroinappbrowser.HybridNitroInAppBrowserSpec 6 | import com.margelo.nitro.nitroinappbrowser.NitroInAppBrowserOptions 7 | import kotlinx.coroutines.MainScope 8 | 9 | class HybridNitroInAppBrowser: HybridNitroInAppBrowserSpec() { 10 | private val inAppBrowser = NitroInAppBrowserImpl(NitroModules.applicationContext) 11 | private val scope = MainScope() 12 | 13 | override fun open(url: String, options: NitroInAppBrowserOptions?): Promise { 14 | return Promise.async(scope) { 15 | inAppBrowser.open(url, options) 16 | } 17 | } 18 | 19 | override fun close(): Promise { 20 | return Promise.async(scope) { 21 | inAppBrowser.close() 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/nitroinappbrowserexample/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.nitroinappbrowserexample 2 | 3 | import com.facebook.react.ReactActivity 4 | import com.facebook.react.ReactActivityDelegate 5 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled 6 | import com.facebook.react.defaults.DefaultReactActivityDelegate 7 | 8 | class MainActivity : ReactActivity() { 9 | 10 | /** 11 | * Returns the name of the main component registered from JavaScript. This is used to schedule 12 | * rendering of the component. 13 | */ 14 | override fun getMainComponentName(): String = "NitroInAppBrowserExample" 15 | 16 | /** 17 | * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] 18 | * which allows you to enable New Architecture with a single boolean flags [fabricEnabled] 19 | */ 20 | override fun createReactActivityDelegate(): ReactActivityDelegate = 21 | DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) 22 | } 23 | -------------------------------------------------------------------------------- /nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinappbrowser/NitroInAppBrowserOptions.kt: -------------------------------------------------------------------------------- 1 | /// 2 | /// NitroInAppBrowserOptions.kt 3 | /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. 4 | /// https://github.com/mrousavy/nitro 5 | /// Copyright © 2025 Marc Rousavy @ Margelo 6 | /// 7 | 8 | package com.margelo.nitro.nitroinappbrowser 9 | 10 | import androidx.annotation.Keep 11 | import com.facebook.proguard.annotations.DoNotStrip 12 | import com.margelo.nitro.core.* 13 | 14 | 15 | /** 16 | * Represents the JavaScript object/struct "NitroInAppBrowserOptions". 17 | */ 18 | @DoNotStrip 19 | @Keep 20 | data class NitroInAppBrowserOptions 21 | @DoNotStrip 22 | @Keep 23 | constructor( 24 | @DoNotStrip 25 | @Keep 26 | val dismissButtonLabel: NitroInAppBrowserDismissButtonLabel?, 27 | @DoNotStrip 28 | @Keep 29 | val presentationStyle: NitroInAppBrowserPresentationStyle?, 30 | @DoNotStrip 31 | @Keep 32 | val barColor: String?, 33 | @DoNotStrip 34 | @Keep 35 | val controlColor: String? 36 | ) { 37 | /* main constructor */ 38 | } 39 | -------------------------------------------------------------------------------- /nitrogen/generated/ios/NitroInAppBrowserAutolinking.mm: -------------------------------------------------------------------------------- 1 | /// 2 | /// NitroInAppBrowserAutolinking.mm 3 | /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. 4 | /// https://github.com/mrousavy/nitro 5 | /// Copyright © 2025 Marc Rousavy @ Margelo 6 | /// 7 | 8 | #import 9 | #import 10 | #import "NitroInAppBrowser-Swift-Cxx-Umbrella.hpp" 11 | #import 12 | 13 | #include "HybridNitroInAppBrowserSpecSwift.hpp" 14 | 15 | @interface NitroInAppBrowserAutolinking : NSObject 16 | @end 17 | 18 | @implementation NitroInAppBrowserAutolinking 19 | 20 | + (void) load { 21 | using namespace margelo::nitro; 22 | using namespace margelo::nitro::nitroinappbrowser; 23 | 24 | HybridObjectRegistry::registerHybridObjectConstructor( 25 | "NitroInAppBrowser", 26 | []() -> std::shared_ptr { 27 | std::shared_ptr hybridObject = NitroInAppBrowser::NitroInAppBrowserAutolinking::createNitroInAppBrowser(); 28 | return hybridObject; 29 | } 30 | ); 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "allowUnreachableCode": false, 5 | "allowUnusedLabels": false, 6 | "esModuleInterop": true, 7 | "forceConsistentCasingInFileNames": true, 8 | "jsx": "react", 9 | "lib": ["esnext"], 10 | "module": "esnext", 11 | "moduleResolution": "node", 12 | "noEmit": false, 13 | "noFallthroughCasesInSwitch": true, 14 | "noImplicitReturns": true, 15 | "noImplicitUseStrict": false, 16 | "noStrictGenericChecks": false, 17 | "noUncheckedIndexedAccess": true, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "resolveJsonModule": true, 21 | "skipLibCheck": true, 22 | "strict": true, 23 | "target": "esnext", 24 | "verbatimModuleSyntax": true 25 | }, 26 | "exclude": [ 27 | "**/node_modules", 28 | "**/lib", 29 | "**/.eslintrc.js", 30 | "**/.prettierrc.js", 31 | "**/jest.config.js", 32 | "**/babel.config.js", 33 | "**/metro.config.js", 34 | "**/tsconfig.json" 35 | ], 36 | "include": ["src/**/*", "nitrogen/**/*.json"] 37 | } 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # XDE 6 | .expo/ 7 | 8 | # VSCode 9 | .vscode/ 10 | jsconfig.json 11 | 12 | # Xcode 13 | # 14 | build/ 15 | *.pbxuser 16 | !default.pbxuser 17 | *.mode1v3 18 | !default.mode1v3 19 | *.mode2v3 20 | !default.mode2v3 21 | *.perspectivev3 22 | !default.perspectivev3 23 | xcuserdata 24 | *.xccheckout 25 | *.moved-aside 26 | DerivedData 27 | *.hmap 28 | *.ipa 29 | *.xcuserstate 30 | project.xcworkspace 31 | 32 | # Android/IJ 33 | # 34 | .classpath 35 | .cxx 36 | .gradle 37 | .idea 38 | .project 39 | .settings 40 | local.properties 41 | android.iml 42 | 43 | # Cocoapods 44 | # 45 | example/ios/Pods 46 | 47 | # Ruby 48 | example/vendor/ 49 | 50 | # node.js 51 | # 52 | node_modules/ 53 | npm-debug.log 54 | yarn-debug.log 55 | yarn-error.log 56 | 57 | # BUCK 58 | buck-out/ 59 | \.buckd/ 60 | android/app/libs 61 | android/keystores/debug.keystore 62 | 63 | # Yarn 64 | .yarn/* 65 | !.yarn/patches 66 | !.yarn/plugins 67 | !.yarn/releases 68 | !.yarn/sdks 69 | !.yarn/versions 70 | .kotlin 71 | 72 | # Expo 73 | .expo/ 74 | 75 | # generated by bob 76 | lib/ 77 | tsconfig.tsbuildinfo -------------------------------------------------------------------------------- /android/src/main/java/com/nitroinappbrowser/NitroInAppBrowserPackage.java: -------------------------------------------------------------------------------- 1 | package com.nitroinappbrowser; 2 | 3 | import android.util.Log; 4 | import androidx.annotation.Nullable; 5 | import androidx.annotation.NonNull; 6 | 7 | import com.facebook.react.bridge.NativeModule; 8 | import com.facebook.react.bridge.ReactApplicationContext; 9 | import com.facebook.react.module.model.ReactModuleInfoProvider; 10 | import com.facebook.react.TurboReactPackage; 11 | import com.margelo.nitro.core.HybridObject; 12 | import com.margelo.nitro.nitroinappbrowser.NitroInAppBrowserOnLoad; 13 | 14 | import java.util.HashMap; 15 | import java.util.function.Supplier; 16 | 17 | public class NitroInAppBrowserPackage extends TurboReactPackage { 18 | @Nullable 19 | @Override 20 | public NativeModule getModule(@NonNull String name, @NonNull ReactApplicationContext reactContext) { 21 | return null; 22 | } 23 | 24 | @NonNull 25 | @Override 26 | public ReactModuleInfoProvider getReactModuleInfoProvider() { 27 | return HashMap::new; 28 | } 29 | 30 | static { 31 | NitroInAppBrowserOnLoad.initializeNative(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Patrick Kabwe 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/NitroInAppBrowserExample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "scale" : "1x", 46 | "size" : "1024x1024" 47 | } 48 | ], 49 | "info" : { 50 | "author" : "xcode", 51 | "version" : 1 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /nitrogen/generated/ios/NitroInAppBrowserAutolinking.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// NitroInAppBrowserAutolinking.swift 3 | /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. 4 | /// https://github.com/mrousavy/nitro 5 | /// Copyright © 2025 Marc Rousavy @ Margelo 6 | /// 7 | 8 | public final class NitroInAppBrowserAutolinking { 9 | public typealias bridge = margelo.nitro.nitroinappbrowser.bridge.swift 10 | 11 | /** 12 | * Creates an instance of a Swift class that implements `HybridNitroInAppBrowserSpec`, 13 | * and wraps it in a Swift class that can directly interop with C++ (`HybridNitroInAppBrowserSpec_cxx`) 14 | * 15 | * This is generated by Nitrogen and will initialize the class specified 16 | * in the `"autolinking"` property of `nitro.json` (in this case, `HybridNitroInAppBrowser`). 17 | */ 18 | public static func createNitroInAppBrowser() -> bridge.std__shared_ptr_HybridNitroInAppBrowserSpec_ { 19 | let hybridObject = HybridNitroInAppBrowser() 20 | return { () -> bridge.std__shared_ptr_HybridNitroInAppBrowserSpec_ in 21 | let __cxxWrapped = hybridObject.getCxxWrapper() 22 | return __cxxWrapped.getCxxPart() 23 | }() 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /example/ios/NitroInAppBrowserExample/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyAccessedAPITypes 6 | 7 | 8 | NSPrivacyAccessedAPIType 9 | NSPrivacyAccessedAPICategoryFileTimestamp 10 | NSPrivacyAccessedAPITypeReasons 11 | 12 | C617.1 13 | 14 | 15 | 16 | NSPrivacyAccessedAPIType 17 | NSPrivacyAccessedAPICategoryUserDefaults 18 | NSPrivacyAccessedAPITypeReasons 19 | 20 | CA92.1 21 | 22 | 23 | 24 | NSPrivacyAccessedAPIType 25 | NSPrivacyAccessedAPICategorySystemBootTime 26 | NSPrivacyAccessedAPITypeReasons 27 | 28 | 35F9.1 29 | 30 | 31 | 32 | NSPrivacyCollectedDataTypes 33 | 34 | NSPrivacyTracking 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Resolve react_native_pods.rb with node to allow for hoisting 2 | require Pod::Executable.execute_command('node', ['-p', 3 | 'require.resolve( 4 | "react-native/scripts/react_native_pods.rb", 5 | {paths: [process.argv[1]]}, 6 | )', __dir__]).strip 7 | 8 | platform :ios, min_ios_version_supported 9 | prepare_react_native_project! 10 | 11 | linkage = ENV['USE_FRAMEWORKS'] 12 | if linkage != nil 13 | Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green 14 | use_frameworks! :linkage => linkage.to_sym 15 | end 16 | 17 | target 'NitroInAppBrowserExample' do 18 | config = use_native_modules! 19 | 20 | use_react_native!( 21 | :path => config[:reactNativePath], 22 | # An absolute path to your application root. 23 | :app_path => "#{Pod::Config.instance.installation_root}/.." 24 | ) 25 | 26 | post_install do |installer| 27 | # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202 28 | react_native_post_install( 29 | installer, 30 | config[:reactNativePath], 31 | :mac_catalyst_enabled => false, 32 | # :ccache_enabled => true 33 | ) 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | enable-beta-ecosystems: true 3 | updates: 4 | - package-ecosystem: 'github-actions' 5 | directory: '/' 6 | schedule: 7 | interval: 'daily' 8 | labels: 9 | - 'dependencies' 10 | 11 | - package-ecosystem: 'gradle' 12 | directories: 13 | - '/android/' 14 | - '/example/android/' 15 | schedule: 16 | interval: 'daily' 17 | labels: 18 | - 'nitro-core' 19 | - 'nitrogen' 20 | - 'dependencies' 21 | - 'kotlin' 22 | 23 | - package-ecosystem: 'bundler' 24 | directory: '/example/' 25 | schedule: 26 | interval: 'daily' 27 | labels: 28 | - 'dependencies' 29 | - 'ruby' 30 | 31 | - package-ecosystem: 'npm' 32 | directories: 33 | - '/example/' 34 | - '/' 35 | schedule: 36 | interval: 'daily' 37 | labels: 38 | - 'nitro-core' 39 | - 'dependencies' 40 | - 'typescript' 41 | - 'nitrogen' 42 | 43 | groups: 44 | react-native-cli: 45 | patterns: 46 | - '@react-native-community/cli*' 47 | babel: 48 | patterns: 49 | - '@babel/*' 50 | react-native: 51 | patterns: 52 | - '@react-native/*' 53 | -------------------------------------------------------------------------------- /NitroInAppBrowser.podspec: -------------------------------------------------------------------------------- 1 | require "json" 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = "NitroInAppBrowser" 7 | s.version = package["version"] 8 | s.summary = package["description"] 9 | s.homepage = package["homepage"] 10 | s.license = package["license"] 11 | s.authors = package["author"] 12 | 13 | s.platforms = { :ios => min_ios_version_supported, :visionos => 1.0 } 14 | s.source = { :git => "https://github.com/patrickkabwe/react-native-nitro-in-app-browser.git", :tag => "#{s.version}" } 15 | 16 | s.source_files = [ 17 | # Implementation (Swift) 18 | "ios/**/*.{swift}", 19 | # Autolinking/Registration (Objective-C++) 20 | "ios/**/*.{m,mm}", 21 | # Implementation (C++ objects) 22 | "cpp/**/*.{hpp,cpp}", 23 | ] 24 | 25 | s.pod_target_xcconfig = { 26 | # C++ compiler flags, mainly for folly. 27 | "GCC_PREPROCESSOR_DEFINITIONS" => "$(inherited) FOLLY_NO_CONFIG FOLLY_CFG_NO_COROUTINES" 28 | } 29 | 30 | load 'nitrogen/generated/ios/NitroInAppBrowser+autolinking.rb' 31 | add_nitrogen_files(s) 32 | 33 | s.dependency 'React-jsi' 34 | s.dependency 'React-callinvoker' 35 | install_modules_dependencies(s) 36 | end 37 | -------------------------------------------------------------------------------- /nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinappbrowser/NitroInAppBrowserOnLoad.kt: -------------------------------------------------------------------------------- 1 | /// 2 | /// NitroInAppBrowserOnLoad.kt 3 | /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. 4 | /// https://github.com/mrousavy/nitro 5 | /// Copyright © 2025 Marc Rousavy @ Margelo 6 | /// 7 | 8 | package com.margelo.nitro.nitroinappbrowser 9 | 10 | import android.util.Log 11 | 12 | internal class NitroInAppBrowserOnLoad { 13 | companion object { 14 | private const val TAG = "NitroInAppBrowserOnLoad" 15 | private var didLoad = false 16 | /** 17 | * Initializes the native part of "NitroInAppBrowser". 18 | * This method is idempotent and can be called more than once. 19 | */ 20 | @JvmStatic 21 | fun initializeNative() { 22 | if (didLoad) return 23 | try { 24 | Log.i(TAG, "Loading NitroInAppBrowser C++ library...") 25 | System.loadLibrary("NitroInAppBrowser") 26 | Log.i(TAG, "Successfully loaded NitroInAppBrowser C++ library!") 27 | didLoad = true 28 | } catch (e: Error) { 29 | Log.e(TAG, "Failed to load NitroInAppBrowser C++ library! Is it properly installed and linked? " + 30 | "Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e) 31 | throw e 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /nitrogen/generated/ios/swift/NitroInAppBrowserDismissButtonLabel.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// NitroInAppBrowserDismissButtonLabel.swift 3 | /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. 4 | /// https://github.com/mrousavy/nitro 5 | /// Copyright © 2025 Marc Rousavy @ Margelo 6 | /// 7 | 8 | /** 9 | * Represents the JS union `NitroInAppBrowserDismissButtonLabel`, backed by a C++ enum. 10 | */ 11 | public typealias NitroInAppBrowserDismissButtonLabel = margelo.nitro.nitroinappbrowser.NitroInAppBrowserDismissButtonLabel 12 | 13 | public extension NitroInAppBrowserDismissButtonLabel { 14 | /** 15 | * Get a NitroInAppBrowserDismissButtonLabel for the given String value, or 16 | * return `nil` if the given value was invalid/unknown. 17 | */ 18 | init?(fromString string: String) { 19 | switch string { 20 | case "cancel": 21 | self = .cancel 22 | case "done": 23 | self = .done 24 | case "close": 25 | self = .close 26 | default: 27 | return nil 28 | } 29 | } 30 | 31 | /** 32 | * Get the String value this NitroInAppBrowserDismissButtonLabel represents. 33 | */ 34 | var stringValue: String { 35 | switch self { 36 | case .cancel: 37 | return "cancel" 38 | case .done: 39 | return "done" 40 | case .close: 41 | return "close" 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /example/App.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 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'; 5 | 6 | const AppWrapper = () => { 7 | return ( 8 | 9 |