Skip to content

Commit

Permalink
Merge pull request #543 from phonegap/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
aogilvie committed Jul 8, 2014
2 parents 21390d6 + 5bcaed9 commit bd0092a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This is the official plugin for Facebook in Apache Cordova/PhoneGap!
The Facebook plugin for [Apache Cordova](http://incubator.apache.org/cordova/) allows you to use the same JavaScript code in your Cordova application as you use in your web application. However, unlike in the browser, the Cordova application will use the native Facebook app to perform Single Sign On for the user. If this is not possible then the sign on will degrade gracefully using the standard dialog based authentication.

* Supported on PhoneGap (Cordova) v3.3.0 and above.
* This plugin is build for
* This plugin is built for
* iOS FacebookSDK 3.13.0
* Android FacebookSDK 3.8.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,26 @@ - (void)sessionStateChanged:(FBSession *)session
[FBRequestConnection startForMeWithCompletionHandler:
^(FBRequestConnection *connection, id <FBGraphUser>user, NSError *error) {
if (!error) {
self.userid = user.id;
self.userid = [user objectForKey:@"id"];

// Send the plugin result. Wait for a successful fetch of user info.
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
if (self.loginCallbackId) {
CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
messageAsDictionary:[self responseObject]];
[self.commandDelegate sendPluginResult:pluginResult callbackId:self.loginCallbackId];
[self.commandDelegate sendPluginResult:pluginResult callbackId:self.loginCallbackId];
}
} else {
self.userid = @"";

}
}];
}else {
} else {
// Don't get user's info but trigger success callback
// Send the plugin result. Wait for a successful fetch of user info.
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
if (self.loginCallbackId) {
CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
messageAsDictionary:[self responseObject]];
[self.commandDelegate sendPluginResult:pluginResult callbackId:self.loginCallbackId];
[self.commandDelegate sendPluginResult:pluginResult callbackId:self.loginCallbackId];
}
}
}
break;
Expand Down Expand Up @@ -127,7 +131,7 @@ - (void)sessionStateChanged:(FBSession *)session
alertMessage = @"Error. Please try again later.";
}

if (alertMessage) {
if (alertMessage && self.loginCallbackId) {
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR
messageAsString:alertMessage];
[self.commandDelegate sendPluginResult:pluginResult callbackId:self.loginCallbackId];
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="com.phonegap.plugins.facebookconnect"
version="0.5.1">
version="0.6.0">

<name>Facebook Connect</name>

Expand Down

0 comments on commit bd0092a

Please sign in to comment.