proyecto26 / react-native-inappbrowser

📱InAppBrowser for React Native (Android & iOS) 🤘
https://www.npmjs.com/package/react-native-inappbrowser-reborn
MIT License
1.29k stars 218 forks source link

[TypeError: Cannot read property 'isAvailable' of null] #434

Closed sarvold closed 8 months ago

sarvold commented 10 months ago

Hi, I found no solutions on the issues already reported. I'm using expo CLI.

"dependencies": {
    "expo": "~49.0.7",
    "expo-status-bar": "~1.6.0",
    "react": "18.2.0",
    "react-native": "0.72.3",
    "react-native-inappbrowser-reborn": "^3.7.0"
  },

Create Expo app, install react-native-inappbrowser, import InAppBrowser from 'react-native-inappbrowser-reborn'; and code something implementing it, e.g. including something like if (await InAppBrowser.isAvailable()) {. Start the expo app and test it on any device. Error thrown: [TypeError: Cannot read property 'isAvailable' of null] If console logging InAppBrowser, it happens to be an object as follows: {"close": [Function close], "closeAuth": [Function closeAuth], "isAvailable": [Function isAvailable], "mayLaunchUrl": [Function mayLaunchUrl], "open": [Function open], "openAuth": [Function openAuth], "warmup": [Function warmup]}

Demo app: https://github.com/sarvold/inappBrowser-expo-app

Reproduces on Macs M2 on android and iOS, both emulators and devices with expo.

odera89 commented 10 months ago

Same problem for me

texmex44 commented 10 months ago

Same here on Android

magutierrezApply commented 10 months ago

Same problem

GatienBoquet commented 8 months ago

Same issue. Looking for alternative at the moment =/

jdnichollsc commented 8 months ago

Why you are using this lib with Expo?

catrius commented 2 months ago

I ran into the same problem. After spending some hours searching for a solution, I ended up using Expo's in app browser https://docs.expo.dev/guides/linking/#in-app-browsers.