react-native-inappbrowser icon indicating copy to clipboard operation
react-native-inappbrowser copied to clipboard

react-native-inappbrowser IOS issue

Open shaheerarshad757 opened this issue 2 years ago • 6 comments

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)

shaheerarshad757 avatar Sep 30 '22 12:09 shaheerarshad757

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

UraFIZ avatar Oct 03 '22 10:10 UraFIZ

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

shaheerarshad757 avatar Oct 03 '22 14:10 shaheerarshad757

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

maya-salcedo avatar Dec 14 '22 08:12 maya-salcedo

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

codewithali9 avatar Jan 30 '23 15:01 codewithali9

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)
          }
        }

lgibso34 avatar Oct 23 '23 20:10 lgibso34