How to make app with extended permissions (post to users wall)

mirkoxxl

Newbie
Joined
May 26, 2009
Messages
21
Reaction score
0
I need when user come to my application, that my app ask him to allow acces for user information, and to post on his wall, I have this code but it does not work for me...

Can anyone help me with that.. Thx
Code:
<?
# We require the library
require("facebook.php");

# Creating the facebook object
$facebook = new Facebook(array(
    'appId'  => 'xxxxxxxxxxxxxx',
    'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    'cookie' => true
));

# Let's see if we have an active session
$session = $facebook->getSession();

if(!empty($session)) {
    # Active session, let's try getting the user id (getUser()) and user info (api->('/me'))
    try{
        $uid = $facebook->getUser();
        $user = $facebook->api('/me');
        $url = $facebook->getLoginUrl(array(
    'req_perms' => 'email,user_birthday,status_update,publish_stream,user_photos,user_videos'
));
    } catch (Exception $e){}

    if(!empty($user)){
        # User info ok? Let's print it (Here we will be adding the login and registering routines)
        print_r($user);
    } else {
        # For testing purposes, if there was an error, let's kill the script
        die("There was an error.");
    }
} else {
    # There's no active session, let's generate one
    $login_url = $facebook->getLoginUrl();
  
}

?>
 
I recommend buying the tinytempa app since it's already pre-made but your app will die quick as soon as it gets traffic.
 
In order for your script to actually post to a users wall, PHP needs to make a call to the api. All your doing here is checking for a session.
 
Can you help me with the code?

It's not important if my app die after couple days, I just dont know how to made it..

I was found this tutorial ... {fck URLs :D } blancer {dota} c o m / tutorials/42760/how-to-authenticate-users-with-facebook-connect/

I flowed all steps, but I dont recive first requested for permission.. My App shows me error while loading {app name}
 
Actually my friend, it is not useless at all. Tinietempah's app should NOT be free and only those that say "it's useless" do not know how to use it. End of story.
 
Back
Top