I\'m making an iOS Webapp (i.e. an HTML page that runs in standalone mode - none of the Safari chrome - when the bookmark of the page is added to the homescreen).
I
I used the following to detect if I'm in home screen mode and do the right thing accordingly:
if ("standalone" in navigator && navigator.standalone) {
var permissionUrl = "https://m.facebook.com/dialog/oauth?client_id=" + appId + "&response_type=code&redirect_uri=" + window.location + "&scope=" + app_permissions;
window.location = permissionUrl;
} else {
FB.login(
function(response) {
...
},
{scope: app_permissions}
);
}