現在のユーザーのフィードにオブジェクトを追加する次のコードがあります
id<FBOpenGraphAction> object = (id<FBOpenGraphAction>)[FBGraphObject graphObject];
[object setObject:@"namespace:objectName" forKey:@"type"];
[object setObject:@"Object Title" forKey:@"title"];
[FBRequestConnection startForPostWithGraphPath:@"me/namespace:actionName"
graphObject:object
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
if (error) {
NSLog(@"Error: %@", error.userInfo);
} else {
NSLog(@"Success!!");
}
}];
ただし、次のエラーが表示されます。
2013-06-18 23:12:31.846 Events[707:60b] Error: {
"com.facebook.sdk:ErrorSessionKey" = "<FBSession: 0x14ff95a0, state: FBSessionStateOpen, loginHandler: 0x14dde700, appID: 474218799329968, urlSchemeSuffix: , tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0x14dde850>, expirationDate: 4001-01-01 00:00:00 +0000, refreshDate: 2013-06-18 22:12:06 +0000, attemptedRefreshDate: 0001-12-30 00:00:00 +0000, permissions:(\n \"basic_info\"\n)>";
"com.facebook.sdk:HTTPStatusCode" = 500;
"com.facebook.sdk:ParsedJSONResponseKey" = {
body = {
error = {
code = 1611072;
message = "The action you're trying to publish is invalid because it does not specify any reference objects. At least one of the following properties must be specified: event.";
type = Exception;
};
};
code = 500;
};
}