Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8635205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:55:04+00:00 2026-06-12T09:55:04+00:00

Hi i am using this code to send the feed to specific user by

  • 0

Hi i am using this code to send the feed to specific user by providing id in $gg_fbid.
is there any way to send the feed via Facebook application and access token to all the users using Facebook Application in PHP SDK.
yes thats what i want, is that possible or should i make a separate database to store their id

  require_once("fb/facebook.php");

  $gg_fbid='100004012849319';

    $facebook = new Facebook(array(
  'appId'  => 'xxxxxxxxxxxxxxxxxx',
  'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxx',
));


  $attachment = array
 (
 'access_token'=>$facebook->getAccessToken(),
 'message' => 'This Page is awesome.',
 'name' => 'Must Like It',
 'caption' => 'Dailyjokes',
 'link' => 'http://facebook.com/wtfdailyjokes/',
 'description' => 'Awesome Picture',
 'picture' => 'https://www.facebook.com/photo.php?fbid=264680606974256&set=a.206648236110827.41772.206637039445280&type=1&relevant_count=1'
 );
 $result = $facebook->api($gg_fbid.'/feed/','post',$attachment);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:55:06+00:00Added an answer on June 12, 2026 at 9:55 am

    There is no way to directly post to wall of Users Using Facebook Application About any Event or something, Thats Why answering my own Question. Facebook permission publish_stream is necessary for this to work. /

    You need to create a Database of users when they use your Application like in my Code

            $facebook = new Facebook(array(
      'appId'  => 'xxxxxxxxxxxxxxx',
      'secret' => 'xxxxxxxxxxxxxxxxxxxxxx',
    ));
    $args = array(
        'message'   => 'Your Message to user Wall',
        'link'      => 'http://apps.facebook.com/lxxxxxxxx',
        'caption'   => ' Use this Awesome application or Like this Page.',
        'picture'      => 'http://xxxxx.png',
    
    
    
    );
    $post_id = $facebook->api("/me/feed", "post", $args);
    
    
      define('db_user','username);
      define('db_password','password');
      define('db_host','localhost');
      define('db_name','database name');
    
      // Connect to MySQL
      $dbc = @mysql_connect (db_host, db_user, db_password) OR die ('Could not connect to  MySQL: ' . mysql_error() );
        // Select the correct database
       mysql_select_db (db_name) OR die ('Could not select the database: ' . mysql_error() );
    
    
      $me = $facebook->api('/me'); 
    
            $dbcheck = mysql_query("SELECT * FROM users WHERE oauth_provider = 'facebook' AND     oauth_uid = ". $me['id']);  
     $dbr = mysql_fetch_array($dbcheck);  
    
    if(empty($dbr)){ 
    
      $db=mysql_query("INSERT INTO users (oauth_provider, oauth_uid, username) VALUES ('facebook', {$me['id']}, '{$me['name']}')  ");
    
    }
    

    SO posting my original Code to tell you in Detail.

    This is code when person first opens your application, this $args gets posted to user wall and the id and username is stored to the Database.

    SO in the future if anything you want to post to users wall who are using your application and also granted the permission.You can do like promoting website or Facebook Fan Page.

    Last how this really happened. As Mr Martin is saying we will need 10 access token for 10 users but thats not correct if your are posting from application than Application token is used to post on all users wall at a time , So with a single access token of Application you can post to million users if your apps has that. SO how to get that access token of application using this link

    https://graph.facebook.com/oauth/access_token?type=client_cred&client_id=xxxxxxxxx&client_secret=xxxxxxxxxxxxxxxxxxxxxxxx
    

    After that fetch all ids in array and execute the same code to post on all users wall using for loop or anyway still i give my code which i used.

    <?php 
    
     require_once("fb/facebook.php");
    
        $facebook = new Facebook(array(
      'appId'  => 'xxxxxxxxxx',
      'secret' => 'xxxxxxxxxxxxxxxxxx',
    ));
    
    
    $x=array("100001944919003","100000968648478","100001672538252","100003924282886");
    
    $y=0;
    
    
    while($y<=3){
    
         $posting_fbid=$x[$y];
    
         $attachment = array
     (
     'access_token'=>'access token from the url from the graph api',
     'message' => 'This Page is awesome.',
     'name' => 'DailyJokes-Must Like It',
     'caption' => 'Dailyjokes',
     'link' => 'http://facebook.com/wtfdailyjokes/',
     'description' => 'Awesome Picture',
     'scope' => 'publish_stream',
     'picture' => 'https://www.facebook.com/photo.php?fbid=264680606974256&set=a.206648236110827.41772.206637039445280&type=1&relevant_count=1'
     );
    
      $result = $facebook->api($posting_fbid.'/feed/','post',$attachment);
    
        echo 'successful for id '.$posting_fbid.'<br>';
    
        $y++;
    
    }
    
    
      ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm using this code to send app requests to users in my facebook application
I am using this code to send an SMTP email via the yahoo SMTP
I am using this code to send mail with php http://www.siteduzero.com/tutoriel-3-35146-e-mail-envoyer-un-e-mail-en-php.html#ss_part_4 . This code
Using this code, i am able to send a notification to my own device.
i'm using MFMailComposer to send an image.m using this code MFMailComposeViewController *picker = [[MFMailComposeViewController
I have this code written in .NET 4.0 using VS2010 Ultimate Beta 2: smtpClient.Send(mailMsg);
I am using this code to send email var message = new MailMessage(abc@somedomain.com, administrator@anotherdomain.com);
I am using this code in my app which will help me to send
I just tried to send email using this code and it seems to work:
I am using this code to send a file to server upload an image

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.