{"library":"react-native-inappbrowser-reborn","title":"In-App Browser for React Native","description":"react-native-inappbrowser-reborn is a JavaScript library providing a robust interface to the system's native web browser functionality within a React Native application. It leverages Chrome Custom Tabs on Android and SafariServices/AuthenticationServices on iOS to offer a rich, secure, and performant in-app browsing experience. The current stable version is 3.7.1, released recently, demonstrating active development and maintenance. The package aims for a regular release cadence, incorporating new features and bug fixes as seen in its recent minor and patch updates. Key differentiators include its cross-platform compatibility, support for handling complex redirects (crucial for OAuth flows), extensive customization options for the browser UI, and built-in error handling. It's actively used in several production applications, highlighting its reliability and maturity for critical use cases like authentication and external link handling.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install react-native-inappbrowser-reborn"],"cli":null},"imports":["import InAppBrowser from 'react-native-inappbrowser-reborn';","import type { InAppBrowserOptions } from 'react-native-inappbrowser-reborn';","import InAppBrowser from 'react-native-inappbrowser-reborn';\nconst authUrl = await InAppBrowser.openAuth(url, redirectUrl, options);"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import React from 'react';\nimport { Button, SafeAreaView, StyleSheet } from 'react-native';\nimport InAppBrowser from 'react-native-inappbrowser-reborn';\n\nconst App = () => {\n  const openBrowser = async () => {\n    const url = 'https://www.google.com';\n    try {\n      if (await InAppBrowser.is\\\\Available()) {\n        const result = await InAppBrowser.open(url, {\n          // iOS Properties\n          dismissButtonStyle: 'cancel',\n          preferredBarTintColor: '#4537FE',\n          preferredControlTintColor: 'white',\n          readerMode: false,\n          animated: true,\n          modalPresentationStyle: 'fullScreen',\n          modalTransitionStyle: 'coverVertical',\n          modalEnabled: true,\n          enableBarCollapsing: false,\n          // Android Properties\n          showTitle: true,\n          toolbarColor: '#4537FE',\n          secondaryToolbarColor: 'black',\n          navigationBarColor: 'black',\n          navigationBarDividerColor: 'white',\n          enableUrlBarHiding: true,\n          enableDefaultShare: true,\n          forceCloseOnRedirection: false,\n          hasBackButton: true,\n          // Specify browser package for Android\n          // browserPackage: 'com.android.chrome',\n          // Show in-app browser initially\n          showInRecents: true,\n        });\n        console.log('Browser result:', result);\n      } else {\n        console.log('InAppBrowser not available. Opening with Linking.');\n      }\n    } catch (error) {\n      console.error('Error opening browser:', error.message);\n    }\n  };\n\n  return (\n    <SafeAreaView style={styles.container}>\n      <Button title=\"Open Google.com\" onPress={openBrowser} />\n    </SafeAreaView>\n  );\n};\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    justifyContent: 'center',\n    alignItems: 'center',\n  },\n});\n\nexport default App;","lang":"typescript","description":"This quickstart demonstrates how to open a URL using InAppBrowser.open, including platform-specific customization options and basic error handling, after checking for availability.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}