I am using Facebook plugin to show comment box.
I am facing problem with facebook session maintenance i.e if user logins using facebook dialog(browser),then user is able to comment in the comment box in my app.
But If the Facebook login in the app was done using the native Facebook application, then the user is prompted to first login to comment in the comment box, which is some what weird for user since he/she already did the Facebook login initially.
The reason for it may be that facebook login using facebook native app and dialog may return different auth tokens.
Is there any way I can use native fb token for browser fb login?
Please if somebody can help in this.
This is currently not possible. The Facebook for Android application and the Facebook login through your browser on your device share different sessions and the session from one is not able to access the session from the other. Your users will need to login to their Facebook account through their mobile browsers in order to comment directly on your page.
However in the next release of the Comments plugin Facebook will soon be introducing comment mirroring to the comments plugin which will allow you to share the same comment thread on your Facebook Page that you are having on your site.
This new product is highlighted here and is currently in beta: https://developers.facebook.com/products/social-plugins/comments/
Related
I just implemented the login with Facebook SDK on a mobile app I developed for both Android and iOS, and was wondering if it's possible to have my users like my Facebook page as part of the login. In other words, can I have my users both login with Facebook and like my page with the same click?
That will be a violation of Facebook's platform policies. Another thing that might be worth noting is that 'liking' an object will probably require 'publish_actions' permission from the user which means you will have to submit your app for review.
I would like to know if it is possible to login without facebook or any social network already used in the OS without having to enter login / password, like it happens for stackoverflow login in a browser.
I'd like to have 3 icons, facebook, g+ and twitter, and connect user just with a clic.
Is it possible???
Tx
The android facebook SDK utilizes the already installed facebook app to get the users credentials using OAuth. If the facebook app isn't installed, the facebook SDK will show a popup screen prompting the user to fill in his facebook credentials.
Without facebook being installed on the device (and have the user already logged into it), there's no way to get a facebook login without the user providing a username / password. If there was a way, that would be a major security breach.
The reason it works in Stack Overflow (and other sites) is because there is a cookie on your computer which already contains the facebook login credentials, provided you have logged in with facebook on the browser and enabled the "remember me" feature.
It happens in Stackoverflow, if you are already logged in Facebook with the same browser and the cookie is set.
Similarly, it can happen in your Android app, if the user has installed Facebook app already and is logged in that app.
You should use the LoginButton widget of Facebook to achieve one click login
https://developers.facebook.com/docs/reference/android/current/LoginButton/
I'm using android-simple-facebook, easy for manage basic stuff in facebook.
https://github.com/sromku/android-simple-facebook
In my application, user can login facebook and share my application details. it's work's fine. but when user have a official facebook application and if user is login through that official application or after not log out or start my application and when click on that facebook login, user can automatic login to that facebook login id and password. but i need that in my application user again put user name and their password. how can i do this. please assist me. thank you.
Use this in Facebook authentication method
private void authenticate() {
mFacebook.authorize(this, permissions, Facebook.FORCE_DIALOG_AUTH,
new DialogListener(){
This will help you.
Short answer:
You can't.
Long answer:
Facebook has created SSO (Single Sign On) for the explicit reason of making authentication easy for third-party app users. Not to mention, keeping the actual authentication secure.
To get a User to authenticate with Facebook from a third-party application, there are 3 ways. Technically, 2 ways, but the third is to disable SSO and force a browser based application.
If the User does not have the Facebook Application installed on his device, a Web Page will do the authentication duties.
If the User has the Facebook Application installed on the device, the authentication will be done via SSO.
This last one is used by some developers. This is achieved by using FORCE_DIALOG_AUTH intead of DEFAULT_AUTH_ACTIVITY_CODE where you are doing the authentication part in your app. But this is not recommended as it may open up your app to malicious apps that can steal your user's Facebook credentials (SOURCE: Answer by Jesse Chen, who works at Facebook. https://stackoverflow.com/a/12433933/450534. If you would still like to use it
Bottom line is, you cannot have a user authenticate from your application. You will need to do it using the Facebook way.
Is it possible to login into facebook using my own login form in Android & get the facebook user id? I just want to validate the users without need them access their facebook.
In the Android facebook tutorial, the app have to open facebook first so that user can login but there is no automatic close after user login successfully.
Thanks in advance
No, you don't have a way to log the user in through facebook without using their official endpoints.
You can open some sort of browser with the authentication dialog (or the open graph one) but that still mean using their forms/ui (what ever you want to call it).
You should just use the android sdk without using the SSO, that way the sdk won't call the facebook application that is installed on the device (if at all) and will just call the auth dialog for you.
This is a better solution for you since it "abstracts" some things from you, takes care of the access token and more.
Here's a thread about disabling the SSO: How to disable Facebook single sign on for android - Facebook-android-sdk
I want to use the facebook sdk and be able to automatically login after the app has already logged in once.
Currently from what I can gather if you use the facebook api and you have the facebook app installed and you have signed in with the facebook app then you don't have to login and you will be automatically logged in.
But if you don't have the facebook app then this automatic login will not happen. -----------I want to handle this case and be still able to automatically log in after the user has logged in with my app once.-------------. From my understanding the facebook sdk requires you to login if the facebook app is not there.
Also if the user has logged in once with my app, I will have the access token then as long as the access token has not expired then you don't need to log in again. But if the access token expires then you have to log in again.
Any help will be appreciated. Thanks.
The functionality you're describing is called single sign on. Facebook has an entire article dedicated to describing how it works and how to implement it. Enjoy:
http://developers.facebook.com/docs/guides/mobile/android_sso/