Facebook API Login - Error Only On Mobile Device - facebook-login

I've implemented Facebook login as a mobile web. But there is something wrong.
When I click the login button, it jumps out the authentication page.
After pressing confirm, it should jump back to my original page and with status logged in.
However, on both iPhone and hTc, it just won't come back to the page.
But when I manually refresh again the original page, I'm logged in.
The login function works well when I use my PC to login, but got error on iPhone and hTc.
In other word, this issue only appears on my mobile device.

Related

Facebook logout url without using Facebook SDK

I'm building a site using React which logs the user in to facebook and fetches their data, which I then use to call another API. This works fine.
What I'm trying to do is then log the user out. I am not using the Facebook SDK.
I can't figure out how to get the logout redirect URL to work. I have the following piece of code which executes upon the user clicking the 'logout' button:
window.location.replace(`https://www.facebook.com/logout.php?next=https://example.com&access_token={accessToken}`
but this appears to just redirect me to the Facebook homepage, and no logging out or redirecting back to my site occurs. I can't find an example in the Graph API documentation that doesn't use the Facebook SDK.

Users forced to login while accessing facebook wall or fan pages on mobile devices

Since last week, users are forced to login page while accessing our facebook wall or fan pages in mobile browsers. It works great on regular browsers. Why this sudden change on mobile devices.
Wall pages were always viewable except you have some age restrictions in the Settings. Now all of a sudden facebook started forcing users to login ?
Steps to reproduce:
Open safari browser on Iphone
Open https://m.facebook.com/socialtwist
User is navigated to facebook login page
NOTE:Until the week before it was working, users were able to view the facebook walls without loggging in.(They use to see a Signup and Login buttons)
User should be able to view the wall page without logging in. This works on regular browsers for both m.facebook.com/socialtwist and www.facebook.com/socialtwist
I've noticed the same thing with my Facebook page. Obviously they changed the rules on us, again. As an alternative, you can get the RSS feed for your Facebook Fan Page and display your content to the mobile device that way. See this article for how to get the RSS feed:
http://just-ask-kim.com/facebook-fan-page-rss-feed-url/#.UYAzeILzMWQ

How to perform instant Facebook login for a link to Facebook login-enabled site

I wonder what is the right technique to streamline the login to my site via Facebook.
Currently, I have a web site integrated with Facebook Login button. Right now, it's an independent web site, and not a "Facebook app" (running in the canvas). While this is not my decision, this could change in long term if matters.
The way the authentication work: the "fb-login-button" is redirected to my application URL using onlogin() event; the server side uses the cookie to retrieve the "access token" and perform further Graph API work. The business logic resides on the server side.
The current business requirement is the following:
Suppose someone posts a link to my site, somewhere in Facebook, for example in our site community page:
http://www.mysitedomain.com/offer1
A Facebook logged-in user clicking on the link - should get to the target page, after his Facebook identify got verified, and the result should be personalized for that user.
If a Facebook user already has an active session with my site - trivial.
Assuming a user had approved my site (app) in the past, but has no active session - here I am looking for the best practice to do the login.
Also, I would appreciate a hint how to handle the app authorization (i.e. showing the Facebook authorization dialog) in a most efficient way.
Thanks for any hint.
Check out FB Login Architecture and FB.getLoginStatus. Based on FB documentation, If you use javascript sdk, it only triggers a Popup on the same page and once authenticated it will go back to the same page. So once the login status is confirmed then you can get users information from graph api and update via AJAX on your page. You can also checkout this server side login. Hope this helps.

Facebook login button not redirecting on mobile devices

I'm implementing a Facebook login button on my site via ...I'm using the auth.login function in javascript SDK to redirect the users. On a desktop the user is prompted for a username and pass, and then is redirected to the page first.php...However, on mobile devices, the user is prompted to verify, but is then redirected to the facebook home page..I think this is because of my redirection method, can anybody offer some help?
This answer is based on the comments below the original question. To use the authenticate dialog, you must have a Facebook application setup. If you don't want a Facebook application, then you cannot use the authenticate dialog. Remember, if you want to play in Facebook's sandbox, then you must play by their rules and not look for ways to "game the system".
So, to make it work on mobile devices, you must configure your application to work in the mobile environment. Go to your application settings and ensure you have the mobile part filled in correctly.

Facebook iframe app. it is possible refresh when user log out from other browser tab

I have an iframe application.
When a user and another page and log in to facebook site, the application page is reloaded by facebook.
But, I want to reload the page in the logout state also.
Here is the scenario:
A user enters my iframe application and authorizes my app and successfully enters my app.
While using my app, the user opens my app (or fb site) in another browser tab.
The user logs out from facebook site in the last browser tab.
When user logs out from facebook, I want to automatically reload my application page in the browser.
How can I do this?
Have a look at FB.Event.subscribe, I think you should be able to use it to reload the page when the user's session changes.
Add something like this to your FB.init:
FB.Event.subscribe("auth.sessionChange", handleSessionChange);
...and the handleSessionChange callback function would look something like this:
function handleSessionChange(response) {
if(!response.session || response.session.uid!="$user_id"){
window.location.reload();
}
}
Unfortunately, your options are limited as communication with an IFRAME is very constrained. This may help you:
http://www.dyn-web.com/tutorials/iframes/refs.php