I am using the react-facebook-login library in my React application to implement a Facebook login button. Here's the code for the FacebookSignInButton component:
import React from "react";
import FacebookLogin from "react-facebook-login/dist/facebook-login-render-props";
const FacebookSignInButton=()=>{
const responseFacebook=(response)=>{
console.log(response);
};
return (
<>
<FacebookLogin
appId="FACEBOOK_APP_ID"
autoLoad
callback={responseFacebook}
scope="email"
render={(renderProps) => (
<div
onClick={renderProps.onClick}
className="w-14 h-14 text-center rounded-full bg-blue-500 text-white saturate-100 transition-all hover:bg-blue-600"
>
<button className="block mx-auto mt-4">
<i className="fab fa-facebook-f fa-lg"></i>
</button>
</div>
)}
/>
</>
);
};
export default FacebookSignInButton;
However, when I try to use the Facebook login button, I get an error message that says: "Invalid Scopes: email. This message is only shown to developers. Users of your app will ignore these permissions if present."
I have set the scope prop to email to request the user's email during the login process. But it seems that there is an issue with the scopes. I have already referred to the Facebook documentation on valid permissions (https://developers.facebook.com/docs/facebook-login/permissions), but I can't figure out what is causing the error. Can anyone help me understand why I am getting this error and how I can fix it to properly request the user's email during Facebook login?
enter image description here
enter image description here
Add this script in body of html and replace your app id
then make a function in component like this