-1

誰かがJsonデータからプロフィール写真を取得する方法を知っています、私はすべての情報(usernam、firstname、FacebookId)を取得しますが、私のプロフィールの写真のリンクを取得できません:

namespace djepo\UserBundle\Security\User\Provider;

use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
use Symfony\Component\Security\Core\User\UserProviderInterface;
use Symfony\Component\Security\Core\User\UserInterface;
use \BaseFacebook;
use \FacebookApiException;

class FacebookProvider implements UserProviderInterface
{
/**
 * @var \Facebook
 */
protected $facebook;
protected $userManager;
protected $validator;
....
....
public function loadUserByUsername($username)
{           
    $user = $this->findUserByFbId($username);


    try {
        $fbdata = $this->facebook->api('/me');// Here I Get all information without pic
    } catch (FacebookApiException $e) {
        $fbdata = null;
    }

    if (!empty($fbdata)) {     
        var_dump($fbdata);// here I see object with result of data
        exit();
        $user_by_mail=$this->userManager->findUserBy(array('email'=>$fbdata['email']));

      .....
       ....
4

1 に答える 1

0

あなたが彼らのユーザー名を持っているなら、あなたがする必要があるのは以下をカールすることだけです:

http://graph.facebook.com/username/picture

curlopt設定でリダイレクトを許可する必要がある場合があります。

于 2013-01-02T14:52:10.430 に答える