GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - rescript-react-native/inappbrowser: ReScript bindings for react-native-inappbrowser-reborn

BranchesTags
Open more actions menu

Latest commit

 

History

11 Commits
11 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src
src
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.node-version
.node-version
 
 
.prettierignore
.prettierignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
bsconfig.json
bsconfig.json
 
 
package.json
package.json
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

@rescript-react-native/inappbrowser

Build Status Version ReScript Forum

ReScript bindings for react-native-inappbrowser-reborn.

Exposed as ReactNativeInAppBrowser module.

@rescript-react-native/inappbrowser X.y.* means it's compatible with react-native-inappbrowser-reborn X.y.*

Installation

When react-native-inappbrowser-reborn is properly installed & configured by following their installation instructions, you can install the bindings:

npm install @rescript-react-native/inappbrowser
# or
yarn add @rescript-react-native/inappbrowser

@rescript-react-native/inappbrowser should be added to bs-dependencies in your bsconfig.json:

{
  //...
  "bs-dependencies": [
    "@rescript/react",
    "rescript-react-native",
    // ...
+    "@rescript-react-native/inappbrowser"
  ],
  //...
}

Usage

open Js.Promise;
open ReactNativeInAppBrowser;

let opts = iosOptions(~preferredBarTintColor="#ff0000", ());
openBrowser("https://rescript-lang.org", `IosOptions(opts))
|> Js.Promise.then_((result: browserResult) => {
     Js.log(result.resultType);
     resolve();
   })
|> ignore;
open Js.Promise;
open ReactNativeInAppBrowser;

openAuthIos("https://example.com/auth", "myschema://auth", `IosOptions(iosOptions()))
|> Js.Promise.then_((result: authResult) => {
     switch (result.url) {
       | Some(url) => Js.log(url)
       | None => Js.log("Something went wrong")
     };
     resolve();
   })
|> ignore;

Types

authResult

browserResult

iosOptions

androidOptions

Methods

ReactNativeInAppBrowser.openBrowser

(string,  [ `AndroidOptions(androidOptions) | `IosOptions(iosOptions) ]) => Js.Promise.t(browserResult)

ReactNativeInAppBrowser.close

unit => unit

ReactNativeInAppBrowser.openAuth

(string, [ `AndroidOptions(androidOptions) | `IosOptions(iosOptions) ]) => Js.Promise.t(authResult)

ReactNativeInAppBrowser.closeAuth

unit => unit

Changelog

Check the changelog for more informations about recent releases.


Contribute

Read the contribution guidelines before contributing.

Code of Conduct

We want this community to be friendly and respectful to each other. Please read our full code of conduct so that you can understand what actions will and will not be tolerated.

About

ReScript bindings for react-native-inappbrowser-reborn

Topics

in-app-browserinappbrowserreactreact-nativerescriptrescript-reactrescript-react-native

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

2 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

Generated from rescript-react-native/__template__
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.