0

I am new to facebook's javascript sdk and am trying to get ads_read and ads_management permissions, I created an app added marketing api and Facebook Login for Business to it and added necessary permissions to its Configuration and followed the quickstart to get users SUAT but I am getting this response

{
  "authResponse": null,
  "status": "unknown"
}

here is my code for reference

<!DOCTYPE html>
<html lang="en">
<head>
    <title>Home</title>
</head>
<body>
<script>
    window.fbAsyncInit = function() {
        FB.init({
            appId            : 'APP_ID',
            autoLogAppEvents : true,
            xfbml            : true,
            version          : 'v17.0'
        });
    };
</script>
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js"></script>
<script>
function loginWithFacebook() {
    FB.login(
        function(response) {
            console.log("response: ", response);
        },
        {
            config_id: 'CONFIG_ID',
            response_type: 'code'
        }
    );
}
</script>
<p>hi edit</p>
<button onclick="loginWithFacebook()">Login</button>
</body>
</html>
2
  • I am having same issue. I've tried everything online from third party cookie, so digging deep into my config in facebook dev, business pages. I did get a connected response when i switch from a SUAT token to a user access token. This sucks bc the UAT only lasts short term but I am hoping I can swap it out on a server to server call for a long term token. Will keep you posted if I figure anything out. Commented Jul 20, 2023 at 15:08
  • Were you able to figure out how to get SUAT working or swap the UAT for a long lived token?
    – pnadolny
    Commented Jan 22 at 15:47

1 Answer 1

0

With test user you are login with. make sure test user is admin in both partner & client business account & in app user roles.

Than you should be able to generate access_token

Not the answer you're looking for? Browse other questions tagged or ask your own question.