I am using expo for a react native app. I am using a development build on an iOS simulator so that I am able to use Auth0 as my authentication package. I am using their build in sdk function authenticate() which launches the login page. It worked a couple times, then suddenly whenever it goes to my auth page it says “safari can’t open the page because the network connection was lost”. I did a full reset of the ios simulator and it worked again for a couple times then suddenly showed that error again. Seems to be little rhyme or reason to the pattern and I cannot debug the error because it is on the safari popup side of things. I have checked and there is internet connection on the device, if I go to safari I can surf the web like normal. It is an iPhone 16 pro simulator on iOS 18.4 (22E238).
I have tried re building the app, changing to different devices, to no avail. I am at the point where I feel like I need to dig into the underlying code, but the reason I am using expo is because I am new to native development. Many places I have seen suggestions to look at xcode logs but obviously I am not using xcode as I am using react native on expo.
1 Like
Hi @micahcb,
It sounds like the issue may come from the way the cookies are handled. Try logging the issue and provide us with the error message.
Also make sure you’ve set up the SDK correctly using this quickstart guide:
If you have any further questions feel free to reach out.
Have a good one,
Vlad
Hi @Vlad..murarasu, thanks for the response. How am I supposed to log the issue if it happens on the safari pop up. When I console log the response of the authorize() function it is undefined. I have ensured that I set up according to the documentation.
Hi @micahcb,
Welcome to the Auth0 Community!
It’s hard to analize what the issue might be. To make it easier to point out the problem you can try the following things:
- Doing a full reset of the simulator, erasing all content and settings and starting fresh. Try a different simulator, device model, and iOS version.
- Creating a brand new minimal Expo project, add only the react-auth0 SDK, and see if the login fails there too.
Let us know what results you get.
Have a good one,
Vlad
Hi @micahcb,
Thank you for providing the stack trace. Could you also provide the piece of code this error originates from?
Have a good one,
Vlad
This happens from the authorize function in the useAuth() hook. It does however not seem to be happening when I use the Auth0
class. GitHub - auth0/react-native-auth0: React Native toolkit for Auth0 API. Could you walk me through the difference between this and using the hook, the documentation here does not specify how to set it up properly with the class. GitHub - auth0/react-native-auth0: React Native toolkit for Auth0 API