Home > database >  react native supabase facebook login redirect callback site url
react native supabase facebook login redirect callback site url

Time:01-30

I am trying to login with facebook using Supabase on ios emulator. After logging in with Facebook, it redirects me back to localhost. I don't know exactly what to do on this side. Can you help me? I'm still very new.

const onHandleLogin = async () => {
    const {data, error} = await supabase.auth.signInWithOAuth({
      provider: 'facebook',
    });

    if (error) {
      return;
    }

    if (data.url) {
      const supported = await Linking.canOpenURL(data.url);
      if (supported) {
        await Linking.openURL(data.url);
      }
    }
  };

screen shot

After the login process, it still stays on the localhost address on the browser. My purpose is to send it to the application and get token information via the url, but I have no idea how.

supabase

I think I need to make changes here but I don't know what to write in the site url because it is a mobile application.

Thanks for your support and replies.

I tried to login with facebook using supabase, but after logging in, it keeps me in safari and gives token information on localhost. I want to direct the application after the login process and get the token information.

CodePudding user response:

You will need to create a deep link for your React Native app: https://reactnative.dev/docs/linking and then set this as your redirect URL. Here a similar example with Flutter: https://supabase.com/docs/guides/getting-started/tutorials/with-flutter#setup-deep-links

  • Related