Olivier Louvignes created CB-1160: ------------------------------------- Summary: this.webView.sendJavascript() not working when using this.onNewIntent from activity. Key: CB-1160 URL: https://issues.apache.org/jira/browse/CB-1160 Project: Apache Cordova Issue Type: Bug Components: Android Affects Versions: 2.0.0 Reporter: Olivier Louvignes Assignee: Joe Bowser
I've been working on a clean/simple facebook-connect plugin (https://github.com/mgcrea/cordova-facebook-connect). I'm stuck on the Android implementation, I found that in some case, using either this.success() or this.webView.sendJavascript() do not work : FacebookConnect SSO requires a onActivityResult() override to get an intent back from the Facebook application. This method is never called on the plugin so I had to hack this piece of code inside the main activity to broadcast the intent to the plugin : {code:java} @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { //String error = (data != null) ? data.getStringExtra("error") : ""; //Log.d("CordovaActivity", "onActivityResult requestCode=" + requestCode + ", resultCode=" + resultCode + ", error=" + error); super.onActivityResult(requestCode, resultCode, data); if(resultCode == Activity.RESULT_CANCELED) data = new Intent(); data.putExtra("requestCode", requestCode); data.putExtra("resultCode", resultCode); this.onNewIntent(data); } {code} Id does work, as I can get the intent using onNewIntent(Intent intent) in my plugin however, at this point no callback will work, this.webView.sendJavascript neither. Not sure it is an actual bug, but I guess you will probably be the only one able to answer to that. Thanks! -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira