Comments (17)
Could you provide a bit more detail? How are you generating the content for the WebView, or what URL are you trying to load?
from facebook-android-sdk.
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.
private initLikeButton( String urlToLike ) {
likeWebView = (WebView) findViewById( R.id.likeWebView );
likeWebView.getSettings().setJavaScriptEnabled(true);
String url = "http://www.facebook.com/plugins/like.php?" +
"href=" + URLEncoder.encode( urlToLike ) + "&" +
"layout=standard&" +
"show_faces=false&" +
"width=375&" +
"action=recommend&" +
"colorscheme=light&" +
"access_token=" + URLEncoder.encode( FacebookAdapter.getInstance().getAccessToken() );
likeWebView.loadUrl( url );
}
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.
from facebook-android-sdk.
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.
from facebook-android-sdk.
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....
from facebook-android-sdk.
Hello,
is posible to use the Graph API to implement the "Like" methode same as the "me" etc.?
if it is possible then we can just use the relevant String action.
from facebook-android-sdk.
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,
Evgeny
from facebook-android-sdk.
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.
from facebook-android-sdk.
Hi,
Is it possible to use the Like button as the social plugin does, from the Android SDK?
It would be just great to use it with an mFacebook.dialog(...)...
Cheers,
Olga
from facebook-android-sdk.
Hi,
Brent, could you tell us if there is an ETA for a working Like feature? It would really be helpful.
Thanks,
Michael.
from facebook-android-sdk.
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.
from facebook-android-sdk.
That would be great, can we connect on - [email protected]
*
*
*-Evgeny
*
On 17 March 2011 08:41, eldolor <
[email protected]>wrote:
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.
Reply to this email directly or view it on GitHub:
#17 (comment)
from facebook-android-sdk.
Have you guys made any progress on the like button integration?
from facebook-android-sdk.
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.
from facebook-android-sdk.
@eldolor could you elaborate how the flow was controlled and how you verified if a user isnt logged?
from facebook-android-sdk.
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.
from facebook-android-sdk.
Any update on this? Still issue persists...
from facebook-android-sdk.
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.
from facebook-android-sdk.
Related Issues (20)
- Unexpected "Invalid app id" error HOT 1
- Is this repository live? No answers from Facebook employees to many critical issues
- ANR:Input dispatching timed out (4b6b26a xxx/com.facebook.FacebookActivity (server) is not responding. Waited 5005ms for FocusEvent(hasFocus=true)) HOT 1
- There was a problem using Facebook version 12.3.0 integration login
- Log In with Patreon confirmation HOT 1
- Automatic event fb_sdk_settings_changed collects private user data
- Different performance when share the same link by web or native handler.
- Is somebody here from Facebook to solve almost 8 years old serious bug??? Your (and our) users are really angry https://github.com/facebook/facebook-android-sdk/issues/1216 HOT 1
- Use CustomTabActivity to open Fallback Feed Link to fix Embedded WebView Error HOT 1
- SDK impacted by CVE-2022-25647
- SDK should use isDebugEnabledField instead of BuildConfig.DEBUG
- Feature Request: external_id HOT 1
- Invalid Signature HOT 1
- Login for business
- Profile Pic
- Please allow indie developers to impelement Facebook Login without business verification
- Facebook SDK is not adding necessary manifest queries/intents for results from PackageManager.getActivityInfo.
- Important paper's
- SDK show WebView login instead of bring the Facebook App to share my content
- Facebook Deferred DeepLink is not working anymore
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from facebook-android-sdk.