Hello everyone,
I’m currently trying to submit a React Native app to the App Store and got rejected by Apple with the following message:
Guideline 4.0 - Design
We noticed that the user is taken to the default web browser to sign in or register for an account, which provides a poor user experience.Next Steps
To resolve this issue, please revise your app to enable users to sign in or register for an account in the app.
You may also choose to implement the Safari View Controller API to display web content within your app…
To comply with this guideline, I’ve updated my implementation using react-native-auth0
and enabled useSFSafariViewController: true
, like so:
const credentials = await authorize(
{
audience: process.env.EXPO_PUBLIC_AUTH0_AUDIENCE,
},
{
useSFSafariViewController: true,
},
);
This does open the login page within SFSafariViewController, which is accepted by Apple.
However, I’m using passwordless authentication via SMS (phone number), and after entering the code and completing login, the app opens but lands on an “unmatched route” screen in Expo.
Here’s my setup:
- I’m using
react-native-auth0
. - In
app.json
, I have:
{
"scheme": "myapp"
}
In the Auth0 dashboard, my callback URL uses auth0 suggested scheme:
myapp.auth0://YOUR_AUTH0_DOMAIN/ios/YOUR_BUNDLE_ID/callback
Despite that, after the redirect from Safari, the app doesn’t handle it properly and shows an “unmatched route” screen.
Question:
Why does the redirect from Auth0 land on an unmatched route despite the correct scheme?
Any guidance would be greatly appreciated!
Thanks in advance!