Closed clucasalcantara closed 7 years ago
What version of iOS do you have running on your physical device? Also, you could try to launch the app on a device in debug mode and adjust your catch function to log errors like so:
.catch(error) => { console.log(error) /*...*/ }
What do you mean by "it always fails"? Do you get an error?
Could it be that you try call open
from a Modal? Because the current release doesn't work with modals, although a fix has been merged to master already (https://github.com/naoufal/react-native-safari-view/pull/53)
@clucasalcantara If it works in the Simulator but not the device, I'd check the version of iOS running like @RSSfeed mentioned. Safari View controller is only supported on iOS 9+ devices.
I'm going to close this for now, but if you're still having the issue feel free to reopen it with the resulting logs of:
SafariView.isAvailable()
.then(() =>
SafariView.show({
url,
fromBottom: true,
tintColor: "rgb(0,0,0)",
}))
.catch(console.log)
I've followed the instructions here and everything is ok and running on iOS simulator but when I try to run my app on the device it always fails.