开发者

How can i get an extended permission form an existing user in facebook application

i am developing a facebook application.now i need to get more permission form user like user_birthday. is it possible to get these permission开发者_开发百科s from an existing user who has already added this application. or is it possible to ask them these permissions again? anyone please help me...


IF you are using the graph api then you can follow these steps after creating the object of facebook

//Facebook Authentication part
    $session = $facebook->getSession();
    $loginUrl = $facebook->getLoginUrl(
            array(
            'canvas'    => 1,
            'fbconnect' => 0,
            'req_perms' => 'email,publish_stream,status_update,user_birthday, user_location,user_work_history'
            )
    );

    $fbme = null;

    if (!$session) {
        echo "<script type='text/javascript'>top.location.href = '$loginUrl';</script>";
        exit;
    }
    else {
        try {
            $uid      =   $facebook->getUser();
            $fbme     =   $facebook->api('/me');

        } catch (FacebookApiException $e) {
            echo "<script type='text/javascript'>top.location.href = '$loginUrl';</script>";
            exit;
        }
    }

Add new permission in 'req_perms' parameter It will automatically redirect user to get new permissions You can check the related tutorial here http://thinkdiff.net/facebook/graph-api-iframe-base-facebook-application-development/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜