Open OzyOzk opened 1 month ago
Always
Hi all,
I'm unable to authenticate the realm user when I'm running my app on an Android Emulator. I keep getting the following errors;
ERROR [Realm.App - error] App: request location failed (CustomError -1): request to https://services.cloud.mongodb.com/api/client/v2.0/app/application-0-xxxxxx/location failed, reason: Network request failed ERROR [Realm.App - error] App: log_in_with_credentials failed: 0 message: request to https://services.cloud.mongodb.com/api/client/v2.0/app/application-0-xxxxxx/location failed, reason: Network request failed
The authentication works when I use a physical device, but fails instantly when I run on an Emulator. I'm using the customJWT auth flow shown below;
const LogInScreen = () => { const {logInWithJWT, result} = useAuth(); //const {logInWithAnonymous, result} = useAuth(); const login = React.useCallback(async () => { try { var tokens = await SignInAzure(); logInWithJWT(tokens["id_token"]); } catch (error) { console.log(error); } }); return ( <View> <Button title="Sign in to realm" onPress={login} /> </View> ); };
LoginScreen is passed to my UserProvider like so;
<UserProvider fallback={<LogInScreen />}>
I've tried anonymous auth and email password authentication, both of which fail on emulator but succeed on a physical device.
React Version 0.73.1 @realm/react - 0.7.0 realm: 12.9.0
Using a Pixel 5 emulator running platform version 34
<AppProvider id={Config.REALM_APP_ID}> <UserProvider fallback={<LogInScreen />}> <RealmProvider sync={{ flexible: true, initialSubscriptions: { update(subs, realm) { subs.add(realm.objects(TemplateOpportunity)); }, }, }} > <GestureHandlerRootView> <NavigationContainer> <Tabs /> </NavigationContainer> </GestureHandlerRootView> </RealmProvider> </UserProvider> </AppProvider>
12.9.0
Atlas Device Sync
Yes
Android SDK Version 34 & 33
Which debugger for React Native: ..
No response
➤ PM Bot commented:
Jira ticket: RJS-2821
How frequently does the bug occur?
Always
Description
Hi all,
I'm unable to authenticate the realm user when I'm running my app on an Android Emulator. I keep getting the following errors;
The authentication works when I use a physical device, but fails instantly when I run on an Emulator. I'm using the customJWT auth flow shown below;
LoginScreen is passed to my UserProvider like so;
<UserProvider fallback={<LogInScreen />}>
I've tried anonymous auth and email password authentication, both of which fail on emulator but succeed on a physical device.
Stacktrace & log output
Can you reproduce the bug?
Always
Reproduction Steps
React Version 0.73.1 @realm/react - 0.7.0 realm: 12.9.0
Using a Pixel 5 emulator running platform version 34
Version
12.9.0
What services are you using?
Atlas Device Sync
Are you using encryption?
Yes
Platform OS and version(s)
Android SDK Version 34 & 33
Build environment
Which debugger for React Native: ..
Cocoapods version
No response