diff --git a/README.txt b/README.txt
index d37b26d..7c05487 100644
--- a/README.txt
+++ b/README.txt
@@ -22,7 +22,7 @@ Also this tab allows to unlink your Facebook account.
 -- REQUIREMENTS --
 PHP 5.2 or higher versions.
 Drupal 7.x.
-Facebook PHP Library: http://github.com/facebook/php-sdk/  use version 2 as version 3 is not supported.
+Facebook PHP 3.x Library or higher: http://github.com/facebook/php-sdk/ (OAuth 2.0 Support Now)
 Facebook API key: http://www.facebook.com/developers/
 
 
@@ -50,18 +50,6 @@ libraries[facebook-php-sdk][destination] = "modules/fbconnect"
   5. Configure the module through admin interface (admin/settings/fbconnect) using the information provided by Facebook
     (Application ID, Application Secret).
 
-  6. In order for the user's browser to correctly recognize XFBML tags, you need to specify that the page is in XHTML.
-    Edit the "page.tpl.php" file of your current theme. edit the <html> tag and add the facebook xmlns for rendering XFBML.
-
-    Example : <html xmlns:fb="http://www.facebook.com/2008/fbml"
-                    xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>"
-                    lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
-
-    Note: The xmlns:fb attribute (xmlns:fb="http://www.facebook.com/2008/fbml") is required for proper rendering on IE.
-     (Namespaces don't have to point to a valid page, they just need to be a valid Internationalized Resource Identifier (IRI).
-
-  7. Also make sure that your page.tpl.php contains <?php print $closure ?>
-
 -- FAQ --
 
 Q: How to skip linking local account to FB account?
diff --git a/channel.html b/channel.html
new file mode 100644
index 0000000..a7e7f36
--- /dev/null
+++ b/channel.html
@@ -0,0 +1 @@
+<script src="http://connect.facebook.net/en_US/all.js"></script>
\ No newline at end of file
diff --git a/fbconnect.admin.inc b/fbconnect.admin.inc
index 12afae6..665eb54 100644
--- a/fbconnect.admin.inc
+++ b/fbconnect.admin.inc
@@ -58,7 +58,7 @@ function fbconnect_api_keys_settings($form, &$form_state) {
     '#type' => 'textfield',
     '#title' => t('Connect url'),
     '#description' => t('Copy this value into Facebook Applications on Connect settings tab'),
-    '#value' => variable_get('fbconnect_connect_url', $GLOBALS['base_url'] . '/'),
+    '#default_value' => variable_get('fbconnect_connect_url', $GLOBALS['base_url'] . '/'),
   );
 
   //  locale
diff --git a/fbconnect.js b/fbconnect.js
index db8d004..55f6f1a 100644
--- a/fbconnect.js
+++ b/fbconnect.js
@@ -10,7 +10,7 @@ Drupal.fbconnect.init = function () {
   }
 
   if (Drupal.settings.fbconnect.loginout_mode == 'auto') {
-    FB.Event.subscribe('auth.sessionChange', Drupal.fbconnect.reload_ifUserConnected);
+    FB.Event.subscribe('auth.authResponseChange', Drupal.fbconnect.reload_ifUserConnected);
 //    FB.Event.subscribe('auth.login', function(response) {
 //      console.log('event auth.login');
 //    });
@@ -34,8 +34,8 @@ Drupal.fbconnect.logout = function(keep_fbaccount_logged) {
 Drupal.fbconnect.reload_ifUserConnected = function(state) {
   var user = Drupal.settings.fbconnect.user;
 
-  if (!state.session || user.uid) return;
-  if (state.session.uid != user.fbuid) {
+  if (!state.authResponse || user.uid) return;
+  if (state.authResponse.uid != user.fbuid) {
     window.location.reload();
   }
 };
@@ -50,7 +50,7 @@ Drupal.fbconnect.initLogoutLinks = function(context) {
   if (loginout_mode == 'manual') return;
 
   links.addClass('logout_link_inited').bind('click',function() {
-    var fbuid = FB.getSession() && FB.getSession().uid;
+    var fbuid = FB.getAuthResponse() && FB.getAuthResponse().uid;
 
     if (!user.fbuid || user.fbuid != fbuid) return;
     if (loginout_mode == 'auto') {
@@ -88,16 +88,20 @@ Drupal.fbconnect.initLogoutLinks = function(context) {
 
 Drupal.fbconnect.DoFastRegistration =  function(link) {
   FB.login(function(response) {
-    if (response.session && /email/.test(response.perms)) {
-      window.location.href = link.href;
-    }
-  }, {perms:'email'});
+    if (response.authResponse && response.status == 'connected') {
+            FB.api('/me/permissions', function(perms_response) {
+				if(perms_response['data'][0]['email']) {
+			      window.location.href = link.href;
+				}
+            });
+     }
+  }, {scope:'email'});
 };
 
 
 function facebook_onlogin_ready() {
   // http://github.com/facebook/connect-js/issues/194
-  if (!FB.getSession()) {
+  if (!FB.getAuthResponse()) {
     return;
   }
   jQuery("#fbconnect-autoconnect-form").submit();
diff --git a/fbconnect.module b/fbconnect.module
index 5496209..6c2b66f 100644
--- a/fbconnect.module
+++ b/fbconnect.module
@@ -233,18 +233,18 @@ function fbconnect_form_alter(&$form, $form_state, $form_id) {
 
       // Render fbconnect on login block.
     case 'user_login_block':
-      if (!empty($_GET['destination']) && ($_GET['destination'] != 'fbconnect/link') && facebook_client()) {
+      if ((empty($_GET['destination']) || (!empty($_GET['destination']) && ($_GET['destination'] != 'fbconnect/link'))) && facebook_client()) {
 
         #848354 : ask user for email permission when account linking is disabled
         $attr = array();
-        if (variable_get('fbconnect_fast_reg', 0) && variable_get('fbconnect_reg_options', 0)) {
-          $attr = array('perms' => 'email');
-        }
+        //if (variable_get('fbconnect_fast_reg', 0) && variable_get('fbconnect_reg_options', 0)) {
+          $attr = array('scope' => 'email');
+        //}
 
         $form['fbconnect_button'] = array(
           '#type' => 'item',
-          '#description' => t('Sign in using Facebook'),
-          '#value' => fbconnect_render_button($attr),
+          '#title' => t('Sign in using Facebook'),
+          '#markup' => fbconnect_render_button($attr),
           '#weight' => 1,
           '#id' => 'fbconnect_button',
         );
@@ -437,9 +437,7 @@ function fbconnect_get_fbuid($check_connected = FALSE) {
   global $user;
 
   $client = facebook_client();
-  $session = $client->getSession();
-  if ($client && $session != NULL) {
-    $fbuid = $session['uid'];
+  if ($client && $fbuid = $client->getUser()) {
 
     if ($check_connected && $fbuid) {
       if (_get_user_fbuid($user->uid) != $fbuid) {
@@ -482,6 +480,7 @@ function fbconnect_render_js() {
 function fbconnect_page_alter(&$page) {
   if (facebook_client() && !_fbconnect_is_excluded_page($_GET['q'])) {
     $config = fbconnect_get_config();
+    $channel_uri = preg_replace("@'@msi", "\'", "http://".$_SERVER['HTTP_HOST']."/".drupal_get_path('module', 'fbconnect')."/channel.html");
     $page['page_bottom']['fb-init-code'] = array(
       '#type' => 'markup',
       '#markup' => '<div id="fb-root"></div>
@@ -492,7 +491,9 @@ function fbconnect_page_alter(&$page) {
           status : true, // check login status
           cookie : true, // enable cookies to allow the server to access the session
           xfbml : true,
-          logging: \'' . $config['debug'] . '\'
+          logging: \'' . $config['debug'] . '\',
+          channelURL: \'' . $channel_uri . '\',
+          oauth  : true
         });
 
         jQuery(document).trigger(\'fb:init\');
@@ -986,3 +987,7 @@ function fbconnect_menu_alter(&$callbacks) {
 function _fbconnect_is_excluded_page($path) {
   return drupal_match_path($path, variable_get('fbconnect_exclude_patterns', ''));
 }
+
+function fbconnect_rdf_namespaces() {
+  return array('fb' => 'http://www.facebook.com/2008/fbml');
+}
