Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-native-inappbrowser IOS issue #383

Open
shaheerarshad757 opened this issue Sep 30, 2022 · 6 comments
Open

react-native-inappbrowser IOS issue #383

shaheerarshad757 opened this issue Sep 30, 2022 · 6 comments

Comments

@shaheerarshad757
Copy link

Which platform(s) does your issue occur on?

  • emulator

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
Copy link

UraFIZ commented Oct 3, 2022

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

@shaheerarshad757
Copy link
Author

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
Copy link

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

@SherifSamirr
Copy link

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

@lgibso34
Copy link

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants