简体   繁体   中英

Facebook POST TO WALL . How to?

Hi guys I have big problem with " POST TO WALL ". Can someone show me how to do that ?

<?php

 $app_id = "myappid";

 $canvas_page = "mycanvaspage";

 $auth_url = "https://www.facebook.com/dialog/oauth?client_id=" 
        . $app_id . "&redirect_uri=" . urlencode($canvas_page);

 $signed_request = $_REQUEST["signed_request"];

 list($encoded_sig, $payload) = explode('.', $signed_request, 2); 

 $data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);

 if (empty($data["user_id"])) {
        echo("<script> top.location.href='" . $auth_url . "'</script>");
  ?>

I know how to make a POST TO WALL with dialog window but can someone show me how to make it wihout it ?

with facebook php lib , and publish stream permission :

try {
     $facebook -> api ('/' . $fbID . '/feed', 'POST', $post);
       #where $post is array like array('name' => 'test' , 'description' => 'test');
    } catch (FacebookApiException $e) {
     #if eny error
         #u can get it $e -> getMessage() 
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM