Yes. It's working perfect.
Go to FacebookConnectPlugin.m file, find this function
- (void) showDialog:(CDVInvokedUrlCommand*)command
Replace with this code inside that function.
// Save the callback ID
self.dialogCallbackId = command.callbackId;
NSMutableDictionary *options = [[command.arguments lastObject] mutableCopy];
NSString* method = [[NSString alloc] initWithString:[options objectForKey:@"method"]];
if ([options objectForKey:@"method"]) {
[options removeObjectForKey:@"method"];
}
__block BOOL paramsOK = YES;
NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
[options enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
if ([obj isKindOfClass:[NSString class]]) {
params[key] = obj;
} else {
NSError *error;
NSData *jsonData = [NSJSONSerialization
dataWithJSONObject:obj
options:0
error:&error];
if (!jsonData) {
paramsOK = NO;
// Error
*stop = YES;
}
params[key] = [[NSString alloc]
initWithData:jsonData
encoding:NSUTF8StringEncoding];
}
}];
if (!paramsOK) {
CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR
messageAsString:@"Error completing dialog."];
[self.commandDelegate sendPluginResult:pluginResult callbackId:self.dialogCallbackId];
} else {
// Show the web dialog
[FBWebDialogs
presentDialogModallyWithSession:FBSession.activeSession
dialog:method parameters:params
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
CDVPluginResult* pluginResult = nil;
if (error) {
// Dialog failed with error
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR
messageAsString:@"Error completing dialog."];
} else {
if (result == FBWebDialogResultDialogNotCompleted) {
// User clicked the "x" icon to Cancel
//pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR
//messageAsString:@"User cancelled."];
} else {
// Send the URL parameters back, for a requests dialog, the "request" parameter
// will include the resluting request id. For a feed dialog, the "post_id"
// parameter will include the resulting post id.
NSDictionary *params = [self parseURLParams:[resultURL query]];
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:params];
}
}
[self.commandDelegate sendPluginResult:pluginResult callbackId:self.dialogCallbackId];
}];
[super writeJavascript:nil];
}
// For optional ARC support
#if __has_feature(objc_arc)
#else
[method release];
[params release];
[options release];
#endif