Facebook business login with Javascript SDK
1

I have installed a button for Facebook integration on our service using the Javascript SDK.

When the login button is pressed, a separate window for the Facebook login screen appears.

I was unable to retrieve login information with the business Facebook login, but I could retrieve it when switching to the regular Facebook login.

Is there any special setting required to retrieve login information with the business Facebook login?

Below is the source code.

import React, { useEffect } from 'react';

function App() {

const handleClickLoginButton = () => { window.FB.login(response => { if (response.authResponse) { console.log('Welcome! Fetching your information.... '); window.FB.api('/me', function(response) { console.log('Good to see you, ' + response.name + '.'); }); } else { console.log('User cancelled login or did not fully authorize.'); } }); }

const initFacebookLogin = () => { window.FB.init({ appId : 'my app id', cookie : true, xfbml : true, version : 'v18.0' }); }

useEffect(() => { if ( ! document.getElementById('facebook-sdk')) { const script = document.createElement('script'); script.id = 'facebook-sdk'; script.async = true; script.defer = true; script.crossOrigin = 'anonymous'; script.src = "https://connect.facebook.net/ja_JP/sdk.js"; script.onload = initFacebookLogin; document.body.appendChild(script); } }, []);

return (

Facebook Login

); }

export default App;

森田大介
已發問 約 11 個月前
已選擇的回答
1

I am not seeing the login configuration for Facebook Business, you must generate a configuration in the login module with Facebook for companies of your APP and once created it will generate an ID and you must add this to your login.

1月11日下午2:14
Ricardo