5

I embedded the like button as a WebView in my Android app.

I have logged-in to my Android app using the facebook-android-sdk via SSO; but when I clicked the like button, it still prompted the login page (of course it did).

I want to know if there's any way to let the WebView know that I've already logged-in (for example provide the access_token somewhere in the webpage)?

Thanks.

Yi H.
  • 299
  • 5
  • 14
  • May be this will help you http://stackoverflow.com/questions/5108088/android-webview-for-facebook-like-button – Herry Mar 13 '12 at 06:16
  • No, I've tried that solution. I want to use the "logged-in account" (the user has logged-in to my app) to "like", but if the "like button" is in an embedded `WebView`, the `WebView` will require the user to login again (within the `WebView`). – Yi H. Mar 19 '12 at 06:01
  • Did you try to add "the right" cookies into WebView for FB url? Maybe it can help. I'm now struggling with the same problem. – Warlock Sep 20 '12 at 23:31

1 Answers1

0

See my answer to this question. In brief, you can't; but if you get the user to authenticate in the WebView once, you might be able to get the facebook auth cookie out of it and re-insert it into subsequent WebView instances.

Community
  • 1
  • 1
domsom
  • 3,163
  • 1
  • 22
  • 27
  • check this post, there is well-formed library to solve this issue: http://stackoverflow.com/a/23853937/1891118 – Oleksii K. Jun 12 '14 at 14:13