Hi!
We’re building our app using Expo and React Native. We are using the React Native SDK, as documented in the Expo guide Auth0 Expo SDK Quickstarts: Login . The instructions totally work - login/logout works on both iOS and Android, in simulator/emulator and on real hardware.
On iOS, both on the simulator and on real hardware, when we login or logout, the OS prompts us with a pop-up:
“AppName” Wants to Use
“auth0.com ” to Sign In
Cancel Continue
How do we make it not issue that prompt?
tyf
August 11, 2023, 12:10am
3
Hey there @rkasper !
Great to hear login/logout is working as epxected - Please see the following FAQ regarding the alert:
# Frequently Asked Questions
1. [How can I have separate Auth0 domains for each environment on Android?](#1-how-can-i-have-separate-auth0-domains-for-each-environment-on-android)
2. [How can I disable the iOS _login_ alert box?](#2-how-can-i-disable-the-ios-login-alert-box)
3. [How can I disable the iOS _logout_ alert box?](#3-how-can-i-disable-the-ios-logout-alert-box)
4. [Is there a way to disable the iOS _login_ alert box without `ephemeralSession`?](#4-is-there-a-way-to-disable-the-ios-login-alert-box-without-ephemeralsession)
5. [How can I change the message in the iOS alert box?](#5-how-can-i-change-the-message-in-the-ios-alert-box)
6. [How can I programmatically close the iOS alert box?](#6-how-can-i-programmatically-close-the-ios-alert-box)
## 1. How can I have separate Auth0 domains for each environment on Android?
This library internally declares a `RedirectActivity` along with an **intent-filter** in its Android Manifest file to handle the Web Auth callback and logout URLs. While this approach prevents the developer from adding an activity declaration to their apps's Android Manifest file, it requires the use of [Manifest Placeholders](https://developer.android.com/studio/build/manage-manifests#inject_build_variables_into_the_manifest).
Alternatively, you can re-declare the `RedirectActivity` in the `AndroidManifest.xml` file with your own **intent-filter** so it overrides the library's default one. If you do this then the `manifestPlaceholders` don't need to be set as long as the activity contains `tools:node="replace"` like in the snippet below.
```xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="your.app.package">
<application android:theme="@style/AppTheme">
This file has been truncated. show original
That should do the trick
Cheers!
Ty
1 Like
W00t! @tyf , that’s it! Thank you so so much!
And for anyone else watching, the implied code for “Just clearing the credentials from the app will suffice.” is:
await clearCredentials();
My full logout function is:
const logout = async () => {
if (Platform.OS === "ios") {
await clearCredentials();
} else {
try {
await clearSession({
customScheme: process.env.EXPO_PUBLIC_AUTH0_SCHEME,
});
} catch (e) {
console.log("Log out cancelled", e);
}
}
};
2 Likes
tyf
August 12, 2023, 12:10am
5
Hey @rkasper no problem, happy to help! Glad you were able to get this sorted and thanks for sharing your logout funciton
system
Closed
August 26, 2023, 12:10am
6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.