Facebook sdk4 php switch User feature - facebook

I am developing a site to manage Facebook Feeds and is using facebook-php-sdk-v4-4.0-dev.I have the user Login and access token saved to database functionality working properly.
I need to show Switch Facebook User account Option, If he is already logged into facebook account. Currently if he is logged into facebook account on another tab. There will not be facebook authentication, It just shows App Permissions window and then completes facebook login process.
But I found that this option is available in Facebook Login for the Web with the JavaScript SDK example...A pop up come up for Login and you can switch user on top right side.
Please let me know how to accomplish this in PHP sdk 4 or work around, or am I missing something here.
Thanks in advance....
Please see this screenshot
https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-xpf1/t39.2178-6/10574702_711575178930859_1600770327_n.png
I have added a screenshot where JavaScript SDK show switch user button (top right side)when user is logged in to facebook account in another browser tab.(this comes up as pop up)
But there is no such option when using php sdk. instead of pop up, its come as a webpage and it does not have switch user account.

Related

Facebook logout when not authorized

I'm building a public installation using an iPad, built as an iOS web app (using the "Add to Home Screen" functionality) which is going to allow users to share content on Facebook.
I'm currently logging the user in to Facebook and getting them to authorize my Facebook app when they click my custom share button. On a successful login, I open Facebook's Feed dialog and allow them to share. Once they have shared (or clicked cancel) I automatically log them out, making sure that the next user that uses the public installation won't be able to share to the previous user's Facebook account.
This all works well, but things get tricky if someone was to hit my custom share button, log in to Facebook and then not allow my app. This would mean that they have logged in, but as they haven't authorized the app, I don't have an access token, and so can't log them out (FB.logout() requires an access token).
Is there a way around this?
Or is there another way that I can log a user out?
Or is there a safe way to allow a user of a public installation (built in HTML) to share on Facebook and be automatically logged out afterwards? Would building a native obj-c app, and using Facebook's iOS SDK help?
The best I can think of is that if the user logs in but doesn't allow the application, they are told that they need to log out, and redirected to Facebook to be able to do this. However this offers them the chance to browse Facebook and (through shared links in their feed) the whole Internet - this isn't acceptable for our installation.
I solved this problem by creating a native iOS app, where the Facebook share link opened in it's own UIWebView. And once the sharing was complete, I deleted all session & cookie information, effectively logging the user out.

Facebook Website Login

I set up a website http://www.howpedia.de with the framework http://www.question2answer.org/ there is an integrated Facebook login that does not work for me or a fried of mine (so the error is not on my site).
If i click on signup with facebook, the popup for login shows up, asking for permission and closes itself again. But i am not logged in on my site. If i reclick on the login, the popup opens and closes itself with no error or what so ever.
Since i am using an already integrated facebook login plugin from the framework and the thing is working on the official Q&A Site http://www.question2answer.org/qa/ i have no clue what to do.
Steps so far:
Registered an facebook app
enabled login for my site howpedia.de and www.howpedia.de
copied public and private key into my website
facebook login was enabled, sandbox mode is off
I also tried to register another APP to try it with different public / private key, but the result is the same.

posting requires a permission login dialog to appear twice

I am developing a mobile camera app that allows posting a photo on facebook. The camera app is a stand-alone and does not require facebook login when it starts. However I want to allow posting a picture to facebook. It follows that the first time a user will try uploading an image it will have to go through the permission login dialog twice.
I cant find a way to ask the user for access his basic information + posting of an image on his wall with one login dialog.
This seems "by design" if you read: http://developers.facebook.com/docs/concepts/login/permissions-login-dialog/
Its a bad users experience to be transfered in and out the mobile app twice in a row to allow posting.
Is there a way to ask the user for basic information + posting of an image in one pass?
Do the following steps :
1) Go to https://developers.facebook.com/apps
2) Click on your app.
3) Click edit app
4) Click Advanced
5) Check Enhanced Auth Dialog: Disabled
That's it. You have one authentication popup.
You get two pop-ups because one of them is a basic permission popup for the app while the other popup asks for extended permissions i.e. publish_stream to post a photo on behalf of the user. For more info on facebook permissions, go to : https://developers.facebook.com/docs/reference/login/
#Oriel Bergig Facebook update the sdk.
(v3.0.1 as of March 20, 2013. See what's new in 3.0.). Download from this link .
https://developers.facebook.com/android/
Follow the link
Problem is solved .If any issue ping me.

Facebook connect, auto prompt for login

I have added a login button to my site anad added scope to publish actions as per guide i found here: developers.facebook.com/docs/reference/plugins/login/ and this works fine but my question is: How can i have same function but this prompt to show to users without needing to click on the Login Button.
If user has not installed app, he would be prompted automatically to install it.
Thanks for any help.
Use FB.getLoginStatus of the JavaScript SDK to see if you have a user connected to your app visiting your page. If not, redirect them to the server-side auth dialog (using client-side auth would not be a good idea, since most browsers will block a popup that’s opened without any actual user interaction).

create auth permission dialog in facebook

basically i have integrated fb in my app and for that i have created the app in fb developer site.
I have got app id and i have authorized my app with fb using this id.
While asking permissions in fb, the auth dialog havn't appeared good. like i want to display auth dialog as below image.
but i didn't see above style of auth dialog while authorization. How will i get that style of dialog?.
Currently i am getting the below style of dialog.
Please advise in this regards.
Thanks!!!
Go to your facebook profile from which you have created your app,or from which you are accessing your app.
Then go to Privacy Setting -> Apps, Games and Websites
And here go to apps you use there click edit in front of your app and then remove it.
It will simply remove your permission and will ask you again as you have shown in screen.
If anything feel free to ask.