
Facebook API Version 2.0 - Changes and Updates in 2015
Learn about the changes and updates related to Facebook API version 2.0 released on April 24, 2015. Explore the transition process, library modifications, and JavaScript SDK enhancements. Discover the evolving features and functionality of the Facebook API during this period.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Facebook api version 2.0 C&S 2015-04-24
1 2 1. ./app/libraries/Template.php 2. ./app/helpers/common_helper.php 3. ./app/javascript/js/facebook.js 4. ./app/libraries/snssocial.php 5. ./app/controllers/snsredirect.php : : 6. ./app/libraries/social/facebook/base_facebook.php 7. ./app/libraries/tpl_plugin/prefilter.facebook_ver.php 8. ./_compile/admin 9. ./_compile/data . , .
3 1. ./app/libraries/Template.php : prefilter . $this->prefilter $this->prefilter = "adjustPath"; = "adjustPath|facebook_ver";// @2015-04-28
4 2. ./app/helpers/common_helper.php : isfacebook() . Function isfacebook() { $CI =& get_instance(); // facebook grapy api upgrade version@2015-05-01 $fbversion = '2.0'; $CI->fb_available_until = array("20160807"=>'2.0',"20161030"=>'2.1',"20170325"=>'2.2'); foreach($CI->fb_available_until as $fbdate=>$fbver) { if( $fbdate >= date("Ymd") ) { $fbversion = $fbver; break; } } $CI->__APP_VER__ = $fbversion; define('__FB_APP_VER__',$CI->__APP_VER__); .. . }
5 3. ./app/javascript/js/facebook.js : FB.init() ,version:'v2.0' . FB.init({ appId status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true, // parse XFBML, oauth : true }); : plus_app_id, //App ID FB.init({ appId status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true, // parse XFBML, oauth : true, version : 'v2.0' }); : plus_app_id, //App ID
6 3. ./app/javascript/js/facebook.js : JavaScript SDK . js.src = "//connect.facebook.net/en_US/all.js"; js.src = "//connect.facebook.net/en_US/sdk.js";
7 4. ./app/libraries/snssocial.php : . function __construct() { $this->ci =& get_instance(); if( !__FB_APP_VER__ ) { // facebook grapy api upgrade version@2015-04-21 $fbversion = '2.0'; if(!$this->fb_available_until) $this->fb_available_until = array("20160807"=>'2.1',"20161030"=>'2.2',"20170325"=>'2.3'); foreach($this->fb_available_until as $fbdate=>$fbver) { if( $fbdate >= date("Ymd") ) { $fbversion = $fbver; break; } } $this->__APP_VER__ =$fbversion; define('__FB_APP_VER__',$this->__APP_VER__); } .. . }
8 5. ./app/libraries/snssocial.php : get_app_token(), get_token() function get_app_token($appid, $appsecret) { .. $url = 'https://graph.facebook.com/oauth/access_token'; } $url = 'https://graph.facebook.com/v'.$this->__APP_VER__.'/oauth/access_token'; function get_token($appid, $appsecret,$code,$ftype='domain_facebook') { .. $url = 'https://graph.facebook.com/oauth/access_token'; } $url = 'https://graph.facebook.com/v'.$this->__APP_VER__.'/oauth/access_token';
9 6. ./app/controllers/snsredirect.php 1) FB.init() FB.init({ appId: plus_app_id, oauth: true}); FB.init({ appId: plus_app_id, oauth: true, version : 'v{$this->__APP_VER__}'});//@2015-04-28 status: true, cookie: true, xfbml: true, status: true, cookie: true, xfbml: true, 2) JavaScript SDK : js.src = "//connect.facebook.net/en_US/all.js"; js.src = "//connect.facebook.net/en_US/sdk.js";
10 7. ./app/libraries/social/facebook/base_facebook.php protected function getUrl($name, $path='', $params=array()) { $url = self::$DOMAIN_MAP[$name]; } protected function getUrl($name, $path='', $params=array()) { $fbversion = (__FB_APP_VER__)?'v'.__FB_APP_VER__:"v2.0"; $url = self::$DOMAIN_MAP[$name].$fbversion.'/'; }
11 8. ./app/libraries/tpl_plugin/prefilter.facebook_ver.php <?php function facebook_ver($source, $tpl){ $fbversion = (__FB_APP_VER__)?'v'.__FB_APP_VER__:"v2.0"; if( !( preg_match("/(FB\.init\(\{)/",$source) && (preg_match("/(.*version)(.*:)(.*\'$fbversion\')/",$source) || preg_match("/(.*version)(.*:)(.*\'v{APP_VER}\')/",$source)) ) && ( !preg_match("/(FB\.init\(\{)(.*version)(.*:)(.*$fbversion)/",$source) || !preg_match("/(FB\.init\(\{)(.*version)(.*:)(.*v{APP_VER})/",$source)) ) { $source = str_replace("FB.init({","FB.init({version:'$fbversion',",$source); } if( preg_match("/connect.facebook.net\/ko_KR\/all.js/",$source) ) { $source=str_replace("#xfbml=1&appId={APP_ID}","",$source); $source=str_replace("connect.facebook.net/ko_KR/all.js","connect.facebook.net/ko_KR/sdk.js",$source); } return $source; } ?>