2013-10-19 31 views
1

我在集成IOS的PhoneGap使用inAppBrowser Facebook和Twitter application.It正常工作还是昨天evening.But今天在登录时我正在以下错误控制台:PhoneGap的IOS:web视图:didFailLoadWithError - 与指定的主机服务器无法找到

“web视图:didFailLoadWithError - 具有指定主机名的服务器也不会被发现。”

我怎样才能解决这个问题请提出一个解决办法...

感谢

+0

具有u添加<访问起源= “*”/>在乌拉圭回合config.xml中 –

+0

@mvp是的,它是在config.xml中 – asna

+0

已经添加不工作Twitter和FB登录? –

回答

0
You are not showing your code, so not able to see what your authorize url? If thats url not working , you can use following code. 

连接=功能(CLIENT_ID,REDIRECT_URI,显示器) this.client_id = CLIENT_ID?; this.redirect_uri = redirect_uri;

var authorize_url = "https://graph.facebook.com/oauth/authorize?"; 
    authorize_url += "client_id=" + client_id; 
    authorize_url += "&redirect_uri=" + redirect_uri; 
    authorize_url += "&display="+ (display ? display : "touch"); 
    authorize_url += "&type=user_agent"; 

var ref = window.open(authorize_url, 'random_string', 'location=no'); 
ref.addEventListener('loadstart', function(event) { 
        //alert(event.type + ' - ' + event.url); 
}); 
ref.addEventListener('loadstop', function(event) { 
    var access_token = event.url.split("access_token=")[1]; 
    var error_reason = event.url.split("error_reason=")[1]; 

    if(access_token != undefined){ 
      access_token = access_token.split("&")[0];    
     setTimeout(function() { 
        ref.close(); 
        }, 5000); 

    } 
    if(error_reason != undefined){ 

      window.location.href = "error.html"; 
      setTimeout(function() { 
        ref.close(); 
        }, 5000); 
    } 
     //console.log(event.url); alert(event.type + ' - ' + event.url); 

}); 
ref.addEventListener('exit', function(event) { 
        //alert(event.type); 
});} 
相关问题