-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Like Button integration (task #201437) #17
Comments
Could you provide a bit more detail? How are you generating the content for the WebView, or what URL are you trying to load? |
I tried using the iframe code provided by the like button code generator at http://developers.facebook.com/docs/reference/plugins/like. But since an iframe is basically the same thing as a WebView, it seemed redundant to load the code in an iframe and then load the iframe in a WebView. So instead I just loaded the code that would be in the iframe directly into the WebView using the code below. But the same thing happens either way.
} Incidentally, the same issue exists when developing an iPhone app. We don't want the user to have to login to facebook every time they run our app. But unfortunately, if the user has logged into facebook on another computer since the last time they logged into facebook via our app, they'll have to log in again. On the android platform I would think a better solution might be to have a facebook app that you send an intent to that takes care of keeping the user logged in and returning the html for rendering the like button. |
OK, I see, nice trick. Looks like the issue is that there are several types of Facebook cookies, and the one that the Android SDK uses in the WebKit webview is not the same as the one used to implement the "Like" button on the web, hence the need to log in again. I'll find someone who know more about the cookies and see if they can propose a solution. |
Correction: the Facebook Android SDK dialog (such as the login dialog) and the "Like" button currently use the same cookie: a c_user cookie. You are quite right: with a c_user cookie, there are a limited number of sessions that may be active (up to five where the user has checked the "Keep me logged in" button, but only one if they have not), so if the user logs in elsewhere, it may invalid the c_user cookie on the device, requiring the user to log in again when trying to display a like button inside a webView dialog. Using intents or a similar technique, such as creating a "like" dialog type supported by the SDK, or using a different cookie that does not get invalidated or expire, are potential solutions: I'll ask the relevant people what can be done, but I'm not sure if there will be a quick fix.... |
Hello, |
Hi John, Have you managed to solve this problem? I'm currently using WebView and graph API with OAuth to get access_token etc.... however as you know Like is Open Graph protocol and yet not supported on Mobile.... Any idea how to implement it? Cheers, |
Using a WebView with a Like button in it is buggy and unsupported, and is broken if your app uses single sign-on. We're working on a better solution and will let you know when it's ready. |
Hi, |
Hi, Brent, could you tell us if there is an ETA for a working Like feature? It would really be helpful. Thanks, |
I have a couple of Android apps that can leverage the Like button. If you want, I can help you test and enhance the functionality, even if it is in an early development stage. Please let me know. |
That would be great, can we connect on - info@ecoffeecard.com.au
|
Have you guys made any progress on the like button integration? |
I have integrated the Facebook Like Button on my Android apps (Beer Cellar, Wine Cellar). I used a WebView to do so, as described by JohnWeidner. The only part that is tricky is managing the flow when a user is not logged in. I used the View.OnTouchListener to verify that fact, and to control the login process. It was relatively straightforward. |
@eldolor could you elaborate how the flow was controlled and how you verified if a user isnt logged? |
Hello bgold, when sso is implemented, Like button always authenticates the user to log in irrespective of whether we provide the access token or not. I am using the above code to implement the Like button. Is this a bug? Is it documented ? Any workarounds? This will be a terrible user experience if he has to Login to 'Like' each time. Regards, Sad Developer. |
Any update on this? Still issue persists... |
This issue was raised against an previous version of the Facebook SDK for Android. In 2012, the SDK had a significant rewrite and relaunch, and we are closing issues and pull requests that predate that v3.0 release. If you are still experiencing this issue, please raise a new issue with repro steps in the supported SDK (currently v3.6). For more information, please see our Android developer center at https://developers.facebook.com/docs/android. Many thanks for using the Facebook Platform, and your support of this project. |
Android 4.13.1
I'd like to be able to have a WebView with a "Like Button" in it. This almost works. However, even if my app has the "offline_access" permission, the like button wants the user to re-login if they have logged into facebook somewhere else since they last logged into facebook via the app.
The text was updated successfully, but these errors were encountered: