여기서부터 어떻게해야합니까? 이것은 sdk에서 제공된 예제에서 거의 복사 복사입니다. 나는이 사람들이 어떻게이 API로 무엇을 만들 수 있는지 이해하지 못한다. 로그인 등의 프롬프트 화면을 열려면 어떻게해야합니까? 도대체 페이스 북이 그것에 대해 뭐라고 말합니까?Facebook API 도움말
<?php
require 'fb_sdk/src/facebook.php';
// Create our Application instance (replace this with your appId and secret).
$facebook = new Facebook(array(
'appId' => 'APIID',
'secret' => 'SECRET',
));
// Get User ID
$user = $facebook->getUser();
// We may or may not have this data based on whether the user is logged in.
//
// If we have a $user id here, it means we know the user is logged into
// Facebook, but we don't know if the access token is valid. An access
// token is invalid if the user logged out of Facebook.
if ($user) {
try {
// Proceed knowing you have a logged in user who's authenticated.
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}
// Permissions requested from the user.
$par = array();
$par['scope'] = 'user_about_me, read_friendlists';
// Login or logout url will be needed depending on current user state.
if ($user) {
$logoutUrl = $facebook->getLogoutUrl();
} else {
$loginUrl = $facebook->getLoginUrl($par);
}
?>
G ood 응답, @ 졸리 그드 : API를 생각하지 마라. 앱을 가지고 * 당신을 도울 수 있습니다. 앱이 제공 할 내용을 분명히 알게되면 Facebook API와의 통합 지점이 명확 해집니다. 이 [sample] (http://developers.facebook.com/docs/samples/canvas/) 앱을 예로 들어 보면 앱 아이디어를 실현하고 Facebook의 사용자 이름, 이메일, 사진 및 친구들이 필요하다고 결론을 내릴 수 있습니다. 그에 따라 API를 사용하십시오. – ifaour