I'm attempting to post a graph event like so with the new SDK:
FBSDKAccessToken *token = [FBSDKAccessToken currentAccessToken];
FBSDKGraphRequestConnection *connection = [[FBSDKGraphRequestConnection alloc] init];
NSMutableDictionary<FBGraphObject> *action = [FBGraphObject graphObject];
action[@"event"] = @"http://samples.ogp.me/680289198752391";
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc] initWithGraphPath:@"me/friendlish:add" parameters:action tokenString:token.tokenString version:@"v2.3" HTTPMethod:@"POST"];
//
[connection addRequest:request completionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
if(error)
NSLog(@"%@", error);
else
NSLog(@"%@", result);
}];
[connection start];
All works fine, and it posts -- but when I try actually changing up the example to something custom like this:
NSMutableDictionary<FBGraphObject> *action = [FBGraphObject graphObject];
NSMutableDictionary<FBGraphObject> *event = [FBGraphObject openGraphObjectForPost];
event[@"og:title"] = @"My Event";
event[@"og:type"] = @"friendlish:event";
event[@"og:url"] = @"http://www.facebook.com";
event[@"og:description"] = @"Yaba daba doo";
event[@"og:image"] = @"https://fbstatic-a.akamaihd.net/images/devsite/attachment_blank.png";
action[@"event"] = event;
I get a first error in console before the connection NSLogs are called:
Unsupported FBSDKGraphRequest attachment:{ data = { }; "fbsdk:create_object" = 1; "og:description" = "Yaba daba doo"; "og:image" = "https://fbstatic-a.akamaihd.net/images/devsite/attachment_blank.png"; "og:title" = "My Event"; "og:type" = "friendlish:event"; "og:url" = "http://www.facebook.com"; }, skipping.
Then the error from the connection method NSLog:
Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo=0x174077080 {NSLocalizedDescription=unsupported URL, NSUnderlyingError=0x17445f920 "unsupported URL"}