Posts tagged with facebook-javascript-sdk

When creating a Consumer app with the Facebook Login product added (not Facebook Login for Business) you get a simple, single-step dialog to login. You just press "Continue as..." and it's done.

However, you are limited to only two scopes: public_profile and email. The only way I can get additional scopes is to create a Business app and add the Facebook Login for Business product. After doing this the login dialog is completely different. It's a much more complex, multi-step dialog that requires you to choose which businesses to opt-in and other things that need to be configured/confirmed.

It would seem that requesting permissions other than public_profile,email requires a Business app with Facebook Login for Business and the more complex login dialog, but there's a service we use called Flockler that lets you connect your Facebook/Instagram account and this is their Facebook dialog:

Their app uses the Consumer login dialog, but requires all these permissions: pages_read_user_content,pages_read_engagement,pages_manage_metadata,read_insights,business_management,instagram_basic,instagram_manage_comments,instagram_manage_insights

My question is, how can they have the simple Consumer login dialog while requiring all these additional permissions, when the only two permissions available in a Consumer app are public_profile and email?

I am trying to get all types of post's visible on my feed of all the user's, is their any way to do it.

I tried differnt facebook graph api but they are only retruning me posts made by me.

I have read on multiple post that you can only get the post those are made by you.

I just want all the public post data of my facebook wall

Here are the steps I took to get access_token

// Init FB SDK const loadSdk = () => {     window.fbAsyncInit = function () {         window.FB.init({             appId: "218446344509498",             cookie: true,             xfbml: true,             version: "v19.0",         });     };     if (!document.getElementById("facebook-jssdk")) {         const js = document.createElement("script");         js.id = "facebook-jssdk";         js.src = `https://connect.facebook.net/en_US/sdk.js`;         document.body.appendChild(js);     } }; loadSdk(); 

Then I opened the popup that I need for whatsapp embedded sign up

window.FB.login((response) => {     if (response.authResponse) {         const code = response?.authResponse?.code;         console.log(code)     } }, {     config_id: <config-id>, // configuration ID goes here     response_type: "code",     override_default_response_type: true,     scope: 'business_management, whatsapp_business_management, whatsapp_business_messaging', }) 

When I code the code I retrieved my access_token on the server side using the following API

https://graph.facebook.com/v20.0/oauth/access_token?client_id=<client-id>&client_secret=<client-secret&code=<code-i-previously-retrived> 

This returns me an access token that seems to be working with Meta APIs /me, //owned_whatsapp_business_accounts But it returns empty arrays or objects.

When I do the same thing from Meta explorer (select permissions, generate token, copy that token and use, it works)

I have been trying to solve this since many days and not sure where I am doing the mistake.

I want to generate token with correct permissions (it looks like I am doing it because authentication popup also mentions the permissions I requested), and want to able to fetch information from it not empty array

I have created an app on the Facebook developer account and I'm using those details to implement Facebook login in my react-native app. Are there any settings available on the Facebook Developer Account where I can allow login specifically only for my react-native app E.g. by specifying my package name so that the login works only for the app with that package name.

I have developed a Facebook app using Facebook Login for Business where the logged in user can allow the app to retrieve a list of pages the logged in user manages. To get permission for pages_show_list feature, I had to add 'Facebook Login for Business' product to the app and the request got approved by the Facebook App Review team.

However now when I try to login to the Facebook app from a user (that is not listed in the app's user roles) I get "It looks like this app isn't available" soon after the login in the popup. The app is Live but still I get that error. I am trying to implement the same functionality as Senja.io does and they do the same thing and anybody whether they manage pages or not, a business owner or not they can still login and the page selection screen is presented to them. But in my app after someone logs in it shows "It looks like this app isn't available".

I referred the following question on StackOverflow but I couldn't get a proper solution from it. "It looks like this app isn't available" Facebook App Login Error

I have created a separate configuration under Facebook Login for Business and included it in the Facebook login JS code, but there is still no luck with it.

Configuration setting:

Login variation: General

Access token: System-user access token (I used User access token as well but no luck)

Choose token expiration: 60 days

Assets: Pages - Asset required

Permissions: pages_show_list, pages_read_engagement, pages_read_user_content

HTML:

<button onclick="login()">Login with Facebook</button> 

JS:

window.fbAsyncInit = function() {   FB.init({     appId      : '48XXXXXXXXXXX57',     cookie     : true,     xfbml      : true,     version    : 'v20.0'   });   FB.AppEvents.logPageView();    }; (function(d, s, id){   var js, fjs = d.getElementsByTagName(s)[0];   if (d.getElementById(id)) {return;}   js = d.createElement(s); js.id = id;   js.src = "https://connect.facebook.net/en_US/sdk.js";   fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); function login() {   FB.login(     function(response) {         if (response.authResponse) {           console.log('Welcome! Fetching your information.... ');           FB.api('/me', function(response) {             console.log('Good to see you, ' + response.name + '.');             getManagedPages();           });         } else {           console.log('User cancelled login or did not fully authorize.');         }       },        {       config_id: '81XXXXXXXXXXX93',       scope: 'pages_show_list, pages_read_engagement, pages_read_user_content'    }); } 

The error I get presented is "app being not available". Is there a way to publish the app? I have been struggling with this for over a month now and I cannot find a solution. Only the app's Admins, Developers, Testers can get through the login step and choose pages. Please help.