我实际上正在使用这个 js 函数进行 facebook 连接。
window.fbAsyncInit = function(){
FB.init({
appId: '371***********',
status: true,
cookie: true,
xfbml: true ,
oauth:true,
channelUrl: '<?php echo base_url(); ?>fb-channel-file.php' //this domain
});
};
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById("fb-root").appendChild(e);
}());
// FB LOGIN -->
function FBlogin(){
FB.getLoginStatus(function(r){
FB.login(function(response) {
if(response.authResponse) {
$.ajax({
type:'GET',
url: _config_base_url+'/auth/ajax_login',
dataType:'json',
data:{'fb_at':response.authResponse.accessToken},
beforeSend:function(){
notify('Loading ...',false,'notify-info');
},
error:function(_response){
notify('An error occurred, please try again later.',false);
},
success:function(json){
notify_destroy();
window.location.href= _config_base_url+'/profile';
}
});
} else {}
},{scope:'email'/*,user_birthday,user_location*/});
});
}
现在我想重现相同/完全相同的允许人们通过连接的功能Twitter
,我只是将其转为Google+
,但我真的不明白如何将其转为Twitter oAuth.
任何想法?