0

I've faced with very strange issue on LG Pro device (Android OS 4.1.2)

On below page, buttons "OK" and "Cancel" are not clickable.

enter image description here

I can't reproduced described behavior on other devices: G Nexus (4.1.2) and Samsung GS3 (4.1.1).

On LGE device I wasn't be able to continue login process on several markets application. Also the same behavior I had with Facebook Sample application.

I've tried other version of FB SDK, modification/optimization webview - no result.

In standart browser I can click on "OK" and "Cancel" button.

One thing that is working for me is to change WebView layout params from match_parent to wrap_content. I was be able to click on first "Current goals" (basic permissions), but on the second (pusblish permission), webview looks very small at first and then starts increasing height (I can attach screenshot, if my explanation isn't clear).

I've find that there was an issue on Facebook side with that screen. (http://developers.facebook.com/bugs/375733199212934) Maybe it is some king of regression... I don't know.

Anyway, any help and workaround for LG Pro device will be very helpful. Thanks

Preetam Jadakar
  • 4,479
  • 2
  • 28
  • 58
Nickolai Astashonok
  • 2,878
  • 3
  • 20
  • 23

1 Answers1

1

WebView manipulation

You can attach a WebViewClient to the WebView with the setWebViewClient() method. When the loading of the page is finished, you can examine the URL that was loaded (onPageFinished()) and identify if it may be problematic on the current device. If it is probable, then you can run a javascript command that can modify the styles so that the scrolling is not disabled any more. I haven't tried to do this modification yet but I'm pretty sure it can be done as any DOM modification is possible from javascript.

I don't say this is a stable solution. You need to monitor it closely in production but a possible way out of the dead end as FB seems to be reluctant to handle it properly.

Built-in browser solution

You can implement the login and authorization process by using the built in browser. Start an intent with the URL https://www.facebook.com/dialog/oauth?client_id={app-id}&redirect_uri={redirect-uri} (Example in this post: Sending an Intent to browser to open specific URL)

The redirect-uri parameter will tell the browser to get back to your app once the authorization is complete. (Example here: Launch custom android application from android browser) You should use the scheme pattern.

Community
  • 1
  • 1
allprog
  • 16,540
  • 9
  • 56
  • 97
  • Thanks for reply. I will keep in mind this workaround, but I have to find solution using webview... [opening browser is not very good] – Nickolai Astashonok Aug 29 '13 at 10:37
  • what about the new option I just added? – allprog Aug 29 '13 at 11:39
  • I will try. Anyway it's an option that I didn't try. Thanks – Nickolai Astashonok Aug 29 '13 at 11:42
  • I've an even simpler idea: What if you set the minimum size of the WebView to a given size and place it in a ScrollView? I think it's worth giving a try. – allprog Aug 29 '13 at 12:00
  • But honestly, if I were you, I'd try to identify those who may have issues and send them to the built in browser. This may turn down a lot less people than a wacky solution that prevents them from using the app completely. – allprog Aug 29 '13 at 12:04
  • Yep, for sure it makes sense to open browser only for specific situation... But for now I must do it in webview... – Nickolai Astashonok Aug 29 '13 at 12:55