0

I've got the auth system set up on nativescript. When I try to use google signin, though, it doesn't let me use the emulator like I usually can on the web.

Here's the code I'm trying to use:

const auth = firebase().auth();
auth.useEmulator('http://127.0.0.1', 9099)

auth.addAuthStateChangeListener((user) => {
    if (!user) {
        console.log('User is currently signed out!');
    } else {
        console.log('User is signed in!');
    }
})

and the sign in looks like this:

await GoogleSignin.configure()
...
await GoogleSignin.signIn();

No matter what I do the prompt from iOS says, "appname" Wants to Use "google.com" to Sign In

How can I get it to redirect to localhost:9099 properly?

Morgan
  • 11
  • 1
  • Are you using nativescript for an iOS app? If the app is running on the device and the emulators are running on a laptop/desktop, localhost doesn't refer to an emulator, you'll need to use 10.0.2.2 or something else to refer to the non-local machine you're connected to. This article may help: https://stackoverflow.com/questions/9808560/why-do-we-use-10-0-2-2-to-connect-to-local-web-server-instead-of-using-computer – Chris May 15 '23 at 17:19

0 Answers0