12

I am having a problem with a WebView app that I am working on.

We have this responsive website that is being displayed through an android WebView.

The website has a Sign in with Facebook option, this works fine in a mobile browser and on the website itself. Whenever I try to use the WebView app to login using Facebook, it results in a white screen.

I am having difficulties finding a solution to get this to work.

Appreciate any advise.

Keith John Hutchison
  • 4,955
  • 11
  • 46
  • 64
Gayan Hewa
  • 2,277
  • 4
  • 22
  • 41
  • 1
    Possible duplicate of [Making facebook login work with an Android Webview](http://stackoverflow.com/questions/12648099/making-facebook-login-work-with-an-android-webview) – Uyghur Lives Matter Jan 11 '17 at 20:11

2 Answers2

13

I was able to find a solution based on a previous question on stackoverflow.com

Making facebook login work with an Android Webview

Here is a link to my MainActivity : http://pastebin.com/KdzfhqDJ

Community
  • 1
  • 1
Gayan Hewa
  • 2,277
  • 4
  • 22
  • 41
  • Do we have to install Facebook android SDK for the `login with facebook` to work in webview app?? – rAzOr Jul 02 '15 at 11:35
  • 1
    @rAzOr You don't need to do install facebook sdk for that. – Kingston Jan 26 '18 at 18:45
  • Hi, @Gayan I tried your code, I get two errors 1. error: cannot find symbol variable progressBar and error: cannot find symbol variable menu how can I fix these? – Jay Smoke Jul 10 '18 at 17:01
  • 1
    I took them out and I launched the app...but when I click to login. I get a white screen with 1? Any help will be appreciated. @IsaacKingston – Jay Smoke Jul 10 '18 at 17:02
3

I'm fairly certain it's this same issue. Essentially it opens in another window and WebView doesn't support multiple windows out-of-the-box.

Luckily for you, unlike that question which was iOS-specific, if I recall correctly, it's possible to extend WebView to support multiple windows. You'll need to extend WebChromeClient, implement onCreateWindow and use it in your WebView.

Community
  • 1
  • 1
kabuko
  • 36,028
  • 10
  • 80
  • 93