davejohnson/phonegap-plugin-facebook-connect — Issue #84: Android: canceling webview login raises Javascript alert
Author: joelhegg
Created: 2012-01-21 05:36:54+00:00
State: open

I have a PhoneGap app running on the Kindle Fire that uses the Facebook webview support to login. When I cancel that webview I get a Javascript alert dialog that says, "PhoneGap Facebook Connect plugin fail on login!Cancelled".

Looking at the source, this dialog is coming from the following as part of the error callback:
https://github.com/davejohnson/phonegap-plugin-facebook-connect/blob/master/lib/facebook-js-patch#L570

The cancel handler in the ConnectPlugin is what's triggering this.
https://github.com/davejohnson/phonegap-plugin-facebook-connect/blob/master/native/android/src/com/phonegap/facebook/ConnectPlugin.java#L226

From the facebook-js-sdk documentation, cancel is actually supposed to result in the success callback being invoked:
https://github.com/facebook/facebook-js-sdk/blob/master/src/core/auth.js#L185