How to use the react-native-inappbrowser-reborn.isAvailable function in react-native-inappbrowser-reborn

To help you get started, we’ve selected a few react-native-inappbrowser-reborn examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github berty / berty / js / packages / store / services.tsx View on Github external
},
						{ text: 'Go back', onPress: resolve },
					],
				)
			})

			if (!allowNonSecure) {
				return
			}
		}
	} catch {
		Alert.alert('The provided URL is not supported')
		return
	}

	if (await InAppBrowser.isAvailable()) {
		try {
			const response: any = await InAppBrowser.openAuth(authURL, 'berty://', {
				dismissButtonStyle: 'cancel',
				readerMode: false,
				modalPresentationStyle: 'pageSheet',
				modalEnabled: true,
				showTitle: true,
				enableDefaultShare: false,
				ephemeralWebSession: true,
				// forceCloseOnRedirection: false,
			})

			if (!response.url) {
				return
			}
github proyecto26 / react-native-inappbrowser / example / App.js View on Github external
async openLink() {
    const { url, statusBarStyle } = this.state;
    try {
      if (await InAppBrowser.isAvailable()) {
        // A delay to change the StatusBar when the browser is opened
        const animated = true;
        const delay = animated && Platform.OS === 'ios' ? 400 : 0;
        setTimeout(() => StatusBar.setBarStyle('light-content'), delay);
        const result = await InAppBrowser.open(url, {
          // iOS Properties
          dismissButtonStyle: 'cancel',
          preferredBarTintColor: '#453AA4',
          preferredControlTintColor: 'white',
          readerMode: false,
          animated,
          modalPresentationStyle: 'fullScreen',
          modalTransitionStyle: 'partialCurl',
          modalEnabled: true,
          enableBarCollapsing: false,
          // Android Properties
github proyecto26 / react-native-inappbrowser / example / App.js View on Github external
async tryDeepLinking() {
    const loginUrl = 'https://proyecto26.github.io/react-native-inappbrowser/';
    const redirectUrl = this.getDeepLink();
    const url = `${loginUrl}?redirect_url=${encodeURIComponent(redirectUrl)}`;
    try {
      if (await InAppBrowser.isAvailable()) {
        const result = await InAppBrowser.openAuth(url, redirectUrl, {
          showTitle: true,
          toolbarColor: '#6200EE',
          secondaryToolbarColor: 'black',
          enableUrlBarHiding: true,
          enableDefaultShare: true
        });
        await this.sleep(800);
        Alert.alert('Response', JSON.stringify(result));
      } else {
        Alert.alert('InAppBrowser is not supported :/');
      }
    } catch (error) {
      Alert.alert('Something’s wrong with the app :(');
    }
  }

react-native-inappbrowser-reborn

InAppBrowser for React Native

MIT
Latest version published 2 years ago

Package Health Score

59 / 100
Full package analysis