This repository has been archived by the owner on Nov 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
initialize
Matei Radu edited this page Mar 3, 2019
·
3 revisions
1.4.0
.
If you're still using this function, check Migrating from 1.x to 2.x in preparation for the next major release expected for June 2019.
-
settings
: ASettings
object with settings for each platform.
undefined
initialize
will apply the provided settings for all new InAppBrowser.open(url [, settings])
invocations.
This method comes in useful when you have consistent settings across most of your usages so you don't have to pass settings
each time you invoke open
.
Settings provided to open
have priority over the ones set with initialize
and will effectively perform a merge between them.
import { InAppBrowser, initialize } from "@matt-block/react-native-in-app-browser";
// Somewhere in your app initialization logic.
initialize({
android: {
toolbarColor: "red",
showTitle: true
}
});
// Other part of your code base.
// Merged settings for this call will result in:
//
// - toolbarColor: "blue",
// - showTitle: true
InAppBrowser.open("https://www.wikipedia.org/", {
android: {
toolbarColor: "blue"
}
});