Facebook 앱을 작성 중이므로 Facebook 앱 사용자에게만 앱을 보여주고 싶습니다. 사용자 정보를 얻고 싶습니다. 나는 다음과 같은 코드 Facebook 앱이 제대로 작동하지 않습니다.
$facebook = new Facebook(array(
'appId' => 'xxxxxx',
'secret' => 'xxxxxx',
));
$user = $facebook->getUser();
if ($user) {
try {
} catch (FacebookApiException $e) {
error_log($e);
}
}
else{
$urlf= $facebook->getLoginUrl(array('scope' => 'user_status,publish_stream'));
header("Location:".$urlf);
exit;
}
if ($user) {
$user_profile = $facebook->api('/me');
}
여기 $urlf
가 올바른 URL을주고 내가 브라우저에서 해당 URL을 붙여 복사 할 때 잘 작동