Posts under category facebook-graph-api

I am trying to create an application where the application requires access to the Facebook posts(along with post title, posted date, author, all comments and replies). I was looking at the Permissions Reference for Meta Technologies APIs and I noticed a permission named user_posts that allows access to posts that user has made on their timeline. But I want access to any post(with all info like title, date, comments, etc.) that the user has access to. The user needs to copy and paste the url of the Facebook post to my application and I need to get access to the information on that post and work with it to give the desired output to the user.

Is this possible using Facebook OAuth? If not, is there any other way I can accomplish this?

I am facing the same problem as mentioned in this question, Why some ads is not breaking down by link_url_asset, the only difference is that I am pulling data on "Campaign" level.

Since the question was asked long back and there's no answer, so posting it again with my wrapper question.

When I am not applying breakdown, I am getting X number of impressions. But when I apply breakdown on link_url_asset, the breakdown happens but when I add the impressions, the sum does not match with X (less than X).

The reason I want to do breakdown is because I want to pull the utm_campaign value from the website_url attribute in link_url_asset.

I am hitting following endpoint with the params -

/GET https://graph.facebook.com/v19.0/act_{ACCOUNT_ID}/insights?level=campaign&fields=account_name,account_id,campaign_name,impressions,spend,actions&time_range={"since":"2024-04-07","until":"2024-04-07"}&access_token=${ACCESS_TOKEN}&filtering=[{field: "action_type",operator:"IN", value: ['link_click']}]&breakdowns=link_url_asset&use_account_attribution_setting=true 

I am not able to figure out from the Facebook documentation that what am I missing here.

Trying to log in with Facebook using the below code. code

I get the following error: URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs. Error

In the advanced tab, Valid OAuth redirect URIs is set to: https://smarteresto.com/facebookpost/callback

More settings

App key and secret are correct. Facebook SDK for PHP (v5)

I have the following code executing when a user logs in to facebook:

FB.Event.subscribe('auth.authResponseChange', checkLoginState); 

Here is the code to analayse:

    function checkLoginState(response) {         if (response.authResponse) {             // User is signed-in Facebook.             const unsubscribe = onAuthStateChanged(auth, (firebaseUser) => {                 unsubscribe();                 // Check if we are already signed-in Firebase with the correct user.                 if (!isUserEqual(response.authResponse, firebaseUser)) {                     // Build Firebase credential with the Facebook auth token.                     const credential = FacebookAuthProvider.credential(                         response.authResponse.accessToken);                     // Sign in with the credential from the Facebook user.                     let x = signInWithCredential(auth, credential)                         .catch((error) => {                             // Handle Errors here.                             const errorCode = error.code;                             const errorMessage = error.message;                             // The email of the user's account used.                             const email = error.customData.email;                             // The AuthCredential type that was used.                             const credential = FacebookAuthProvider.credentialFromError(error);                             alert("Login failed. Please try again.");                         });                     x.then((userCredential) => {                         // Signed in                         const user = userCredential.user;                         // login(response.authResponse.accessToken, firebasetoken???);                     });                 } else {                     // User is already signed-in Firebase with the correct user.                     console.log(response);                     // login(response.authResponse.accessToken, firebasetoken???);                 }             });         } else {             // User is signed-out of Facebook.             signOut(auth);         }     } 

I'm unsure how to pass the FIREBASE login token to verify in the backend (with kreait):

        $auth = (new Factory)             ->withServiceAccount($_ENV["PATH"].$_ENV['config']['storage']['firebase']['firebase']['file'] ?? 'firebase-service-account.json')             ->createAuth();         // verify token         $verifiedIdToken = $auth->verifyIdToken($token);         $uid = $verifiedIdToken->getClaim('sub'); // throws an InvalidToken when invalid 

Kreait docs: https://github.com/kreait/firebase-php

Any help is appreciated.