Skip to content

Commit e892f93

Browse files
committed
[ios] support for 3.5.2 sdk
1 parent 937f147 commit e892f93

File tree

73 files changed

+14804
-175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+14804
-175
lines changed

plugin.xml

Lines changed: 90 additions & 134 deletions
Large diffs are not rendered by default.

src/ios/FacebookConnectPlugin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88

99
#import <Foundation/Foundation.h>
10-
#import <FacebookSDK/FacebookSDK.h>
10+
#import "FacebookSDK.h"
1111

1212
#import <Cordova/CDV.h>
1313

src/ios/FacebookConnectPlugin.m

Lines changed: 17 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
//
1010

1111
#import "FacebookConnectPlugin.h"
12-
#import "FBSBJSON.h"
1312

1413
@interface FacebookConnectPlugin ()
1514

@@ -288,50 +287,28 @@ - (void) showDialog:(CDVInvokedUrlCommand*)command
288287
if ([obj isKindOfClass:[NSString class]]) {
289288
params[key] = obj;
290289
} else {
291-
// For optional ARC support
290+
NSError *error;
291+
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:obj
292+
options:0
293+
error:&error];
294+
if (jsonData) {
295+
NSString *jsonDataString = [[NSString alloc] initWithData:jsonData
296+
encoding:NSUTF8StringEncoding];
297+
params[key] = jsonDataString;
292298
#if __has_feature(objc_arc)
293-
FBSBJSON *jsonWriter = [FBSBJSON new];
294299
#else
295-
FBSBJSON *jsonWriter = [[FBSBJSON new] autorelease];
300+
[jsonDataString release];
296301
#endif
297-
params[key] = [jsonWriter stringWithObject:obj];
302+
}
303+
// // For optional ARC support
304+
//#if __has_feature(objc_arc)
305+
// FBSBJSON *jsonWriter = [FBSBJSON new];
306+
//#else
307+
// FBSBJSON *jsonWriter = [[FBSBJSON new] autorelease];
308+
//#endif
309+
// params[key] = [jsonWriter stringWithObject:obj];
298310
}
299311
}];
300-
301-
// Show the web dialog
302-
[FBWebDialogs
303-
presentDialogModallyWithSession:FBSession.activeSession
304-
dialog:method parameters:params
305-
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
306-
CDVPluginResult* pluginResult = nil;
307-
if (error) {
308-
// Dialog failed with error
309-
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR
310-
messageAsString:@"Error completing dialog."];
311-
} else {
312-
if (result == FBWebDialogResultDialogNotCompleted) {
313-
// User clicked the "x" icon to Cancel
314-
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_NO_RESULT];
315-
} else {
316-
// Send the URL parameters back, for a requests dialog, the "request" parameter
317-
// will include the resutling request id. For a feed dialog, the "post_id"
318-
// parameter will include the resulting post id.
319-
NSDictionary *params = [self parseURLParams:[resultURL query]];
320-
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:params];
321-
}
322-
}
323-
[self.commandDelegate sendPluginResult:pluginResult callbackId:self.dialogCallbackId];
324-
}];
325-
326-
// For optional ARC support
327-
#if __has_feature(objc_arc)
328-
#else
329-
[method release];
330-
[params release];
331-
[options release];
332-
#endif
333-
334-
[super writeJavascript:nil];
335312
}
336313

337314
- (NSDictionary*) responseObject
10.8 MB
Binary file not shown.
10.7 MB
Binary file not shown.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)