Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4883] Android: CreateLoginButton for Facebook opens blank window (fix included)

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2011-12-22T12:24:04.000+0000
Affected Version/sRelease 1.7.2
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, facebook
ReporterAlan Leard
AssigneeShak Hossain
Created2011-08-03T14:27:50.000+0000
Updated2014-06-19T12:46:41.000+0000

Description

When using CreateLoginButton of the facebook module some device running Android 2.2 and 2.3.3 have the login window stay blank. This is a known Android problem that has fixes not included in the Ti module. problem: https://github.com/facebook/facebook-android-sdk/issues/5 http://www.google.com/#sclient=psy&hl=en&source=hp&q=andorid+facebook+login+blank&pbx=1&oq=andorid+facebook+login+blank&aq=f&aqi=&aql=&gs_sm=e&gs_upl=2085l2777l1l3088l5l4l0l0l0l0l287l985l0.1.3l4l0&bav=on.2,or.r_gc.r_pw.r_cp.&fp=e88d11602cf2fea7&biw=1429&bih=885 Solution: http://myunixworld.blogspot.com/2010/11/android-facebook-sdk-issue-fix-for.html Add following code to FbWebViewClient class in FbDialog.java file.
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler,
SslError error) {

handler.proceed();
}
That mean your code would look like:
private class FbWebViewClient extends WebViewClient {
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler,
SslError error) {

handler.proceed();
}
Ticket and Fix provided by Moshe Marciano

Comments

  1. Bill Dawson 2011-08-22

    All code submissions, no matter how small, require a [pull request and signing of the CLA](http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium). [CLA](http://appc.me/cla)
  2. Bill Dawson 2011-08-22

    Looking at this further, we couldn't accept this code anyway, for a few reasons: a) the onReceivedSslError api appears first in api level 8. Titanium builds to 7. b) More importantly, it seems to me that this code gives the user no say as to whether to investigate certificate error, and just accepts the certificate as-is. This would open up all users of our Facebook module to man-in-the-middle attacks. This problem -- which I've never seen (though I can tell other people have) -- needs to be fixed upstream at Facebook. I'll proceed now by checking the last version of Facebook's code and see if they have a solution.
  3. Bill Dawson 2011-08-25

    A look at latest code from Facebook shows no difference that would affect this.

JSON Source