ios - Sharing Facebook open graph action succeeds, but post isn't visible -
i'm migrating legacy app facebook ios sdk 2.x 3.x, , i'm having trouble getting open graph object share successfully.
here's code have share object:
nsmutabledictionary *properties = [@{ @"og:type": @"my-app:my-object", @"og:title": @"title", @"og:description": @"text", } mutablecopy]; if(photourl){ fbsdksharephoto *photo = [fbsdksharephoto photowithimageurl:[nsurl urlwithstring:photourl] usergenerated:no]; properties[@"og:image"] = @[photo]; } fbsdkshareopengraphobject* graphobject = [fbsdkshareopengraphobject objectwithproperties:properties]; fbsdkshareopengraphaction *action = [[fbsdkshareopengraphaction alloc] init]; action.actiontype = @"my-app:my-action"; [action setobject:graphobject forkey:@"my-object"]; fbsdkshareopengraphcontent *content = [[fbsdkshareopengraphcontent alloc] init]; content.action = action; content.previewpropertyname = @"my-object"; fbsdkshareapi* shareapi = [fbsdkshareapi sharewithcontent:content delegate:[sharedelegate thesharedelegate]]; if(![shareapi share]){ nslog(@"![shareapi share]"); onfail(nil); }else{ nslog(@"share succeeded"); onfinish(); }
the share action appears succeed. delegate method -(void)sharer:(id<fbsdksharing>)sharer didcompletewithresults:(nsdictionary *)results
called results dictionary:
{ completiongesture = post; postid = 1608774589402167; }
but post doesn't appear in test user's news feed. also, on open graph -> action types section of app dashboard @ https://developers.facebook.com see error message:
your open graph action failed publish on of platforms submitted. make sure action working publishing action test user before resubmitting.
this graph action being shared using facebook 2.x sdk ios.
what point of failure be?
i'm not sure if still need answer here, action show in users' timeline need set key on action:
[action setstring:@"true" forkey:@"fb:explicitly_shared"];
this requires configuration custom action (check boxes @ bottom of page).
Comments
Post a Comment