Where can I host fb: explicitly_shared for iOS sdk

This might be a dumb question, but I can't figure out where to add fb: explicitly_shared bool.

I can do this job using the Graph API by simply adding a field and setting it to true. It works like a charm.

But when I try to do this from my iOS application, it just does NOT work.

- (id<OGObject>)myObjectForObject:(NSDictionary*)object { NSString *format = @"http://www.myurl.com/fbobjects/object.php?" @"fb:app_id=<my_app_id>&og:type=%@" @"&fb:explicitly_shared=true" @"&og:title=%@" @"&og:description=%@" @"&og:image=http://www.myimageurl.com/image.png" @"&body=%@"; id<OGObject> result = (id<OGObject>)[FBGraphObject graphObject]; // Give it a URL that will echo back the name of the wod as its title, // description, and body. result.url = [NSString stringWithFormat:format, @"myapp_namespace:object", [object objectForKey:@"title"], [object objectForKey:@"description"], [object objectForKey:@"title"]]; NSLog(@"%@", result.url); return result; } 

This comes directly from the open graph tutorial , basically, except where I added the fb: explicitly_shared bit.

Where do I need to add this when publishing from an iOS device? Any help is much appreciated :)

+4
source share
1 answer

You need to add a parameter to action , and what can I say from your code, it seems you are trying to add it to an object that obviously will not work. Here is how I did it:

 id<GSOGTrackActivityAction> action = (id<GSOGTrackActivityAction>)[FBGraphObject graphObject]; action.activity = activityObject; [(NSMutableDictionary *)action setValue:@"true" forKey:@"fb:explicitly_shared"]; 

(Note that GSOGTrackActivityAction is my own protocol for typing access to an action object. And "track" is my action, and "activity" is my object (in Open Graph).)

+11
source

All Articles