react-native-nitro-in-app-browser
Version:
70 lines (48 loc) • 2.19 kB
Markdown
A Simple React Native Nitro module for in-app browser.
[](https://github.com/patrickkabwe/react-native-nitro-in-app-browser/actions/workflows/android-build.yml)
[](https://github.com/patrickkabwe/react-native-nitro-in-app-browser/actions/workflows/ios-build.yml)
[](https://www.npmjs.com/package/react-native-nitro-in-app-browser)
[](https://www.npmjs.com/package/react-native-nitro-in-app-browser)
> [!IMPORTANT]
> This package requires `react-native-nitro-modules` to be installed first.
> See [react-native-nitro-modules](https://github.com/mrousavy/nitro) for more information.
```sh
bun install react-native-nitro-in-app-browser react-native-nitro-modules@0.28.0
cd ios && pod install && cd ..
```
```js
import React from 'react';
import { Button, SafeAreaView } from 'react-native';
import { NitroInAppBrowser } from 'react-native-nitro-in-app-browser';
const App = () => {
return (
<SafeAreaView>
<Button
title="Open Nowie Tech"
onPress={() => {
try {
await NitroInAppBrowser.open('https://nowietech.com', {
barColor: 'purple',
controlColor: '#000000',
dismissButtonLabel: 'close',
presentationStyle: NitroInAppBrowserPresentationStyle.FullScreen,
});
} catch (error) {
console.error(error);
}
}}
/>
</SafeAreaView>
);
};
export default App;
```
MIT
---
Bootstrapped with [Create Nitro Modules](https://github.com/patrickkabwe/create-nitro-module)
This package is based on the [react-native-nitro-modules](https://github.com/mrousavy/nitro) package.