I need to publish action
I got success in publishing 'liking the link' from graph API. e.g 'abc likes www.abc.com'
now I am stuck at 'liking custom object' e.g 'abc likes toy1' and also to get total number of likes.
This is sample code which is not working
NSDictionary *properties = @{
@"og:type": @"toy",
@"og:title": @"toy1",
@"og:description": @"This is a sample course."};
FBSDKShareOpenGraphObject *object = [FBSDKShareOpenGraphObject objectWithProperties:properties];
FBSDKShareOpenGraphAction *action = [[FBSDKShareOpenGraphAction alloc] init];
action.actionType = @"og.likes";
[action setObject:object forKey:@"toy"];
FBSDKShareOpenGraphContent *content = [[FBSDKShareOpenGraphContent alloc] init];
content.action = action;
content.previewPropertyName = @"toy";
FBSDKShareAPI *shareAPI = [[FBSDKShareAPI alloc] init];
// optionally set the delegate
shareAPI.delegate = self;
shareAPI.shareContent = content;
[shareAPI share];
Edit : My code is working by changing
toy
to
appnamespace:toy
and
[action setObject:object forKey:@"toy"]; // to [action setObject:object forKey:@"object"];
now I want to fetch total number of likes on this custom object