proyecto26 / react-native-inappbrowser

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

react-native-inappbrowser IOS issue #383

Open shaheerarshad757 opened 2 years ago

shaheerarshad757 commented 2 years ago

Which platform(s) does your issue occur on?

Please, tell us how to recreate the issue in as much detail as possible.

Describe the steps to reproduce it.

-While opening inapp browser it shows an error "Another inappbrowser is already being presented" -Works fine when you refresh your code (every time)

UraFIZ commented 2 years ago

According to the prev discussion, this issue could be triggered by this code modalTransitionStyle: partialCurl. Rebuild the project, and it's gone.

shaheerarshad757 commented 2 years ago

According to the prev discussion, this issue could be triggered by this code modalTransitionStyle: partialCurl. Rebuild the project, and it's gone.

Code: const openLink = async () => { try { const isAvailable: any = await InAppBrowser.isAvailable(); const url = "https://www.google.com";

  if (isAvailable) {
    const result: any = await InAppBrowser.open(url, {
      // iOS Properties
      dismissButtonStyle: "cancel",
      preferredBarTintColor: "#453AA4",
      preferredControlTintColor: "white",
      readerMode: false,
      animated: true,
      modalPresentationStyle: "fullScreen",
      modalTransitionStyle: "partialCurl",
      modalEnabled: true,
      enableBarCollapsing: false,

      // Specify full animation resource identifier(package:anim/name)
      // or only resource name(in case of animation bundled with app).
      animations: {
        startEnter: "slide_in_right",
        startExit: "slide_out_left",
        endEnter: "slide_in_left",
        endExit: "slide_out_right",
      },
      headers: {
        "my-custom-header": "my custom header value",
      },
    });
    await sleep(800);
    Alert.alert(JSON.stringify(result));
  } else Linking.openURL(url);
} catch (error: any) {
  Alert.alert(error.message);
}

};

Still getting same error

maya-salcedo commented 1 year ago

@shaheerarshad757 Were you able to solve this issue? I get the same error and behaviour as you have.

codewithali9 commented 1 year ago

this happened with me when I tried modalTransitionStyle: partialCurl just rebuild your project npm start -- --reset-cache

lgibso34 commented 11 months ago

I fixed this with the hack recommended issue 131. It's not great but does seem to work. For the record, I got it working without the catch but I added it to be safe.

        if (await InAppBrowser.isAvailable()) {
          try {
            InAppBrowser.close() // close any left over InAppBrowsers
            InAppBrowser.open(THE_URL, config)
          } catch (e) {
            InAppBrowser.close()
            InAppBrowser.open(THE_URL, config)
          }
        }
leecsargent commented 1 month ago

I've been running into this issue and have been able to determine that it's happening when users are sharing their phone screens on zoom meetings. 100% of my Another inappbrowser is already being presented errors are happening under this condition.