Skip to content
This repository was archived by the owner on Nov 10, 2020. It is now read-only.

Migrating from 1.x to 2.x

Matei Radu edited this page Mar 3, 2019 · 2 revisions

Some functions have been deprecated in version 1.4.0 and are scheduled for removal in 2.0.0 which is expected to be released on June 1st 2019. You can check the rationale behind these braking changes here.

The affected features are:

Below are migration paths for the deprecated features.

openInApp

This function is now exposed as the method open of the object InAppBrowser. Both functions share the same signature.

import openInApp, {
  InAppBrowser
} from "@matt-block/react-native-in-app-browser";

// New usage.
InAppBrowser.open("https://www.wikipedia.org/").catch(error => {
  console.log(error);
});

// Deprecated.
openInApp("https://www.wikipedia.org/").catch(error => {
  console.log(error);
});

initialize

This function is now exposed as the method configure of the object InAppBrowser. Both functions share the same signature.

import {
  initialize,
  InAppBrowser
} from "@matt-block/react-native-in-app-browser";

// New usage.
InAppBrowser.configure({
  android: {
    toolbarColor: "red",
    showTitle: true
  }
});

// Deprecated.
initialize({
  android: {
    toolbarColor: "red",
    showTitle: true
  }
});

closeInAppInstance

This function is now exposed as the method close of the object InAppBrowser. Both functions share the same signature.

import {
  closeInAppInstance,
  InAppBrowser
} from "@matt-block/react-native-in-app-browser";

// New usage.
InAppBrowser.close();

// Deprecated.
closeInAppInstance();
Clone this wiki locally