2012-01-13 44 views
1

我想開發iPhone上使用現有網站的移動版本,我使用的是直的超級鏈接誰的目標正是如此定義:Facebook的API和iPhone優化的登錄頁面

$fb = $this->facebook->getLoginUrl(array(
    'redirect_uri' => $redirect, 
    'scope' => 'email,publish_stream,offline_access,friends_location', 
    'display' => 'popup' 
)); 
    $data['fb_login_url'] = $fb; 

然而,在我的iPhone的Mobile Safari敲擊這需要我似乎是在桌面大小的Facebook登錄頁面:

enter image description here

我怎樣才能得到這個Facebook登錄頁面的移動優化版本?

回答

1

如果需要使用Facebook的登錄功能的JavaScript SDK看到https://developers.facebook.com/docs/guides/mobile/web/#sdk

具體this example

FB.login(function(response) { 
    if (response.authResponse) { 
    console.log('Welcome! Fetching your information.... '); 
    FB.api('/me', function(response) { 
     console.log('Good to see you, ' + response.name + '.'); 
     FB.logout(function(response) { 
     console.log('Logged out.'); 
     }); 
    }); 
    } else { 
    console.log('User cancelled login or did not fully authorize.'); 
    } 
}, {scope: 'email'}); 

調用FB.login()將導致移動網絡版本在新的移動Safari瀏覽器「選項卡」打開