[TIMOB-4883] Android: CreateLoginButton for Facebook opens blank window (fix included)
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2011-12-22T12:24:04.000+0000 |
Affected Version/s | Release 1.7.2 |
Fix Version/s | n/a |
Components | Android |
Labels | android, facebook |
Reporter | Alan Leard |
Assignee | Shak Hossain |
Created | 2011-08-03T14:27:50.000+0000 |
Updated | 2014-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
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)
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.A look at latest code from Facebook shows no difference that would affect this.