react-native-browser

by PrestoDoctor

PrestoDoctor / react-native-browser

Full-featured web browser module for React Native apps, based on TOWebViewController

125 Stars 26 Forks Last release: Not found MIT License 23 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

react-native-browser

A full-featured web browser module for React Native apps, based on the awesome TOWebViewController

TOWebViewController

Installation

  1. Run
    npm install react-native-browser --save
    in your project directory.
  2. Open your project in XCode, right click on
    Libraries
    and click
    Add Files to "Your Project Name"
  3. Inside your node_modules, find react-native-browser and add
    RCTBrowser.xcodeproj
    to your project.
  4. Add
    libRTCBrowser.a
    to
    Build Phases -> Link Binary With Libraries
  5. Whenever you want to use it within your React code, you can:
    var Browser = require('react-native-browser');

Usage

Example:

import {
  processColor, // make sure to add processColor to your imports if you want to use hex colors as shown below
} from 'react-native';

// at the top of your file near the other imports var Browser = require('react-native-browser');

...

// wherever you want to trigger a browser modal appearing Browser.open('https://google.com/');

// OR pass in options to customize Browser.open('https://google.com/', { showUrlWhileLoading: true, loadingBarTintColor: processColor('#d64bbd'), navigationButtonsHidden: false, showActionButton: true, showDoneButton: true, doneButtonTitle: 'Done', showPageTitles: true, disableContextualPopupMenu: false, hideWebViewBoundaries: false, buttonTintColor: processColor('#d64bbd'), titleTintColor: processColor('#d64bbd'), barTintColor: processColor('#d64bbd') });

Descriptions of options and their defaults

TODOs

  • [ ] Finish adding all customization options / support callbacks
  • [ ] Accessors for webview & url requests
  • [ ] Programatic control of loading pages, closing the view, etc

License

MIT License

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.