내 페이스 북 응용 프로그램이 초기에 사용자의 기본 권한을 묻는 중이었습니다. 이제 확장 된 권한을 필요로하는 몇 가지 기능을 추가 했으므로 다음과 같이 코드를 변경하고 제거한 다음, 응용 프로그램을 추가하면 응용 프로그램의 다른 내용을 변경해야합니다.Facebook 응용 프로그램이 기본 대신 확장 된 권한을 요청했습니다.
내가 프로필에서 응용 프로그램을 제거하고 다시 추가하려고하면 기본 정보를 묻는 메시지가 나타납니다.이 경고가 표시 될 때 확장 된 권한이 필요하다고 페이스 북에 어떻게 알릴 수 있습니까? OAuthException : (# 200) 사용자가이 작업을 수행하도록 응용 프로그램을 허가하지 않았습니다.
변경 사항의 앱 비법을 재설정해야합니까?
> $facebook = new Facebook(array( 'appId' => 'xxxxxxxxxxxx',
> 'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx',));
>
> // Get User ID
>
>
> $user = $facebook->getUser(); if ($user) { try {
> // Get the user profile data you have permission to view
> $user_profile = $facebook->api('/me');
> $uid = $facebook->getUser();
>
>
> $url = $facebook->getLoginUrl(array(
> 'canvas' => 1,
> 'fbconnect' => 0,
> 'scope' =>'publish_stream'));
>
>
> $attachment = array (
> 'access_token'=>$facebook->getAccessToken(), 'message' => 'I had a
> question: should I write a PHP facebook app that actually worked?',
> 'name' => 'I Asked Bert', 'caption' => 'Bert replied:', 'link' =>
> 'http://apps.facebook.com/askbert/', 'description' => 'NO',
> 'picture' => 'http://www.facebookanswers.co.uk/img/misc/question.jpg'
>); echo "Test 1";
>
> $result = $facebook->api('/me/feed/','post',$attachment);
>
> echo "Test 2";
> $_SESSION['userID'] = $uid;
>
>
> } catch (FacebookApiException $e) {
> $user = null; } } else { die('Somethign Strange just happened
> <script>top.location.href="'.$facebook->getLoginUrl().'";</script>');
> }
제안에 감사하지만 예외는 여전히 – PUG
는 – PUG
업데이트를 만든 변화가했다. 마지막에는 api 예외 (일명 권한 없음)가있는 경우 두 번째 getLoginUrl을가집니다. 해당 호출에 필요한 범위도 추가하십시오. – bkaid