How do I return to the iPhone web application after I log in to Facebook Connect?

I have a mobile website built using jQuery Mobile. I often run it in a full-screen / mobile web application on my iPhone (I added the web application to my iPhone home screen).

On one of the pages, the user must log in to Facebook using the Facebook Connect JavaScript API. If the user has not logged in yet, this is done by pressing the login button. The event handler for this button looks like this:

("#fbLogin").click(function () {
      FB.login(handleStatusChange(response), 
      { scope: "publish_stream", 
        connect_display: "touch" });
});

In the above code, I inserted some line breaks for better readability, but the values ​​are like in the example. The callback function (handleStatusChange) is responsible for the response from the entry request.

When I click on this, the Facebook login page opens in the window of my web application. If I have not accepted the Facebook application yet, I must grant him permission. It all works fine. But after I gave permission / logged in, I remained hanging on a completely blank screen.

I also tried a different login approach, putting it inside the login button's event handler:

window.location = "https://www.facebook.com/login.php
?api_key=MY_API_KEY
&cancel_url=http%3A%2F%2Fwww.mywebsiteurl.com%3A8081
&fbconnect=1
&next=http%3A%2F%2Fwww.mywebsiteurl.com%3A8081
&return_session=1
&session_version=3
&v=1.0
&req_perms=publish_stream
&connect_display=touch";

Again, line breaks were inserted for better readability. When using it, only one long string.

URL-, cancel_url next, , Facebook. URL- (, http://www.google.com), , . , ( 8081). ?

. /, , , . Facebook.

, , Safari ( - iPhone), .

- , ? - JavaScript API Facebook Connect, /- iPhone?

!

+2
1

, , , iOS Safari Facebook -, "" Safari:

// Make links work in iOS fullscreen web app
function disableSafariLinks() {
    $("a").click(function (event) {
        event.preventDefault();
        window.location = $(this).attr("href");
    });
}

. iPhone Safari Web App

+1

All Articles