The same problem here. Corona Version 2013.1137 (2013.6.7)
Code Lua:
local function webListener( event ) local URLA = event.url if event.url then print( "You are visiting: " .. event.url ) end end local webView = native.newWebView( 0, 0, 320, 480 ) webView:request("http://xxx.xxxx.xxx/xxxxxxxxx") webView:addEventListener( "urlRequest", webListener )
Code HTML:
\<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"\> \<HTML\> \<!--HEAD----------------------------------------------------------------------\> \<HEAD\> \<META NAME="Keywords" VALUE="Quiz, Dilemma"\> \<META NAME="Description" VALUE="DilemmaQuiz"\> \<META NAME="rating" CONTENT="general"\> \<META NAME="revisit-after" CONTENT="7 days"\> \<TITLE\>Dilemma Quiz\</TITLE\> \<style type="text/css"\> #screen { height: 480px; width: 320px; background: #ffd200; position:relative; z-index:0; } .center{ background: #ffd200; bottom: 0; height: 480px; left: 0; margin: auto; position: absolute; top: 0; right: 0; width: 320px; } #FBbutton { position:relative; z-index:2; top: 225px; left: 130px; } \</style\> \</HEAD\> \<!--BODY----------------------------------------------------------------------\> \<BODY LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0" BGCOLOR="#FFFFFF"\> \<div id="fb-root"\>\</div\> \<script\> // Following variables are used in test.pde file var setID; // variable used for invited, passed to HTML by server var myID = 0; var myUSERNAME = ""; var myNAME = ""; var myFRIENDS = new Array(new Array()); var mySTATUS = "create"; // Indicates whether it's create or join state // Additional JS functions here window.fbAsyncInit = function() { FB.init({ appId : 'XXXXXXXXXXXXXXXXXX', // App ID channelUrl : '//www.xxxxxx.xxx/xxxxxxxxxxxx', // Channel File status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); function login(){ FB.api('/me', function(response) { if (response.id \> 0) { myID = response.id; myUSERNAME = response.username; myNAME = response.name; $('#FBbutton').hide(); alert('You have successfully logged in, '+myNAME+"!"); } }); FB.api('/me/friends', function(response) { if(response.data) { $.each(response.data,function(index,friend) { myFRIENDS[index,0] = friend.name; myFRIENDS[index,1] = friend.id; //alert("Yep!"); alert(friend.name + ' has id:' + friend.id + ' index:' + index); }); } else { alert("Log In!"); } }); } function logout(){ //alert('You have successfully logged out!'); } function greet(){ FB.api('/me', function(response) { if (response.id \> 0) { myID = response.id; myUSERNAME = response.username; myNAME = response.name; $('#FBbutton').hide(); alert('Welcome, '+myNAME+"!"); } }); FB.api('/me/friends', function(response) { if(response.data) { $.each(response.data,function(index,friend) { myFRIENDS[index,0] = friend.name; myFRIENDS[index,1] = friend.id; //alert(myFRIENDS[index,0]); alert(friend.name + ' has id:' + friend.id + ' index:' + index); }); } else { alert("Log In!"); } }); } FB.Event.subscribe('auth.login', function(response) { login(); }); FB.Event.subscribe('auth.logout', function(response) { logout(); }); FB.getLoginStatus(function(response) { greet(); }); }; // Load the SDK asynchronously (function(d){ var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]; if (d.getElementById(id)) {return;} js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en\_US/all.js"; ref.parentNode.insertBefore(js, ref); }(document)); \</script\> \<!-- ----------------------------------------------------------------- FACEBOOK LOGIN --\> \<!-- \<fb:login-button id="FBbutton" show-faces="true" width="200" max-rows="1"\>\</fb:login-button\> --\> \<!-- --------------------------------------------------------------------------------- --\> \<script src="jquery-1.10.2.min.js" type="text/javascript"\>\</script\> \<div class="center"\> \<div class="center"\> \</div\> \<fb:login-button id="FBbutton" autologoutlink='true' scope='email, user\_birthday, status\_update, publish\_stream, read\_friendlists'\> \</fb:login-button\> \</div\> \</BODY\> \</HTML\>
It works fine in Safari on iOS, but in webview it opens Facebook login as expected, after username and password is entered it shows just white screen instead of going back to original html file
Sorry for messy code.