🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@reason-react-native/inappbrowser

Package Overview
Dependencies
Maintainers
5
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reason-react-native/inappbrowser

ReScript bindings for react-native-inappbrowser

latest
Source
npmnpm
Version
3.5.0
Version published
Maintainers
5
Created
Source

@reason-react-native/inappbrowser

Chat

ReScript / Reason bindings for react-native-inappbrowser-reborn.

Exposed as ReactNativeInAppBrowser module.

@reason-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 @reason-react-native/inappbrowser
# or
yarn add @reason-react-native/inappbrowser

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

{
  //...
  "bs-dependencies": [
    "reason-react",
    "reason-react-native",
    // ...
+    "@reason-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.

Keywords

rescript

FAQs

Package last updated on 08 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts