1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'FaceBook' started by mirkoxxl, Oct 27, 2010.

  1. mirkoxxl

    mirkoxxl Newbie

    Joined:
    May 26, 2009
    Messages:
    16
    Likes Received:
    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();
      
    }
    
    ?>
    
     
  2. Website

    Website Supreme Member

    Joined:
    Feb 8, 2008
    Messages:
    1,291
    Likes Received:
    286
    Location:
    whitehouse
    I recommend buying the tinytempa app since it's already pre-made but your app will die quick as soon as it gets traffic.
     
  3. Grizzy

    Grizzy Senior Member

    Joined:
    Nov 11, 2008
    Messages:
    919
    Likes Received:
    1,000
    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.
     
  4. mirkoxxl

    mirkoxxl Newbie

    Joined:
    May 26, 2009
    Messages:
    16
    Likes Received:
    0
    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}
     
  5. phph5

    phph5 Regular Member

    Joined:
    Aug 7, 2010
    Messages:
    225
    Likes Received:
    42
    I recommend downloading it for free - just google it lol. But it's useless anyway, so who cares.
     
  6. ShinGouki

    ShinGouki Newbie

    Joined:
    Jun 22, 2010
    Messages:
    24
    Likes Received:
    2
    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.
     
  7. FBInvites.Info

    FBInvites.Info Junior Member

    Joined:
    Oct 11, 2010
    Messages:
    107
    Likes Received:
    32
    Occupation:
    Marketing
    I agree!
     
  8. jwilt2008

    jwilt2008 Newbie

    Joined:
    Oct 29, 2010
    Messages:
    26
    Likes Received:
    1
    interesting looks like i have a lot reading to do.
     
  9. mirkoxxl

    mirkoxxl Newbie

    Joined:
    May 26, 2009
    Messages:
    16
    Likes Received:
    0
    Any other solution, or code? :p