Facebook连接脚本
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Facebook连接脚本相关的知识,希望对你有一定的参考价值。
default facebook connect script
<?php require 'src/facebook.php'; // download from github facebook php sdk // Create our Application instance (replace this with your appId and secret). 'appId' => 'YOUR_APP_ID', 'secret' => 'YOU_SECRET_KEY', 'cookie' => true, )); // We may or may not have this data based on a $_GET or $_COOKIE based session. // // If we get a session here, it means we found a correctly signed session using // the Application Secret only Facebook and the Application know. We dont know // if it is still valid until we make an API call using the session. A session // can become invalid if it has already expired (should not be getting the // session back in this case) or if the user logged out of Facebook. $session = $facebook->getSession(); $fbinfo = null; // Session based API call. if ($session) { try { $fbid = $facebook->getUser(); $fbinfo = $facebook->api('/me'); //print_r($fbinfo); } catch (FacebookApiException $e) { } } ?>
以上是关于Facebook连接脚本的主要内容,如果未能解决你的问题,请参考以下文章
iOS)我应该在哪里复制和粘贴 facebook XML 片段?
Android Studio 中的 Facebook SDK 4 ExceptionInitializeError Login v2.3
PHP中的Facebook Graph API出现不一致的错误 - 无法连接到graph.facebook.com端口443:连接超时