开发者

Facebook publish status

I am using facebook ios api and I want to publish a status for the user if he clicks on something.

The problem is that i want to do it without using the FBDialog and I didn开发者_运维技巧't find anyting that do it - I've only found the method:

[[FBRequest requestWithDelegate:self] call:@"facebook.fql.status" params:params];

But this method is not in use in the API any more.


They replaced the FBRequest with the Graph API which is really easy to use, just with something like this you can be able to post without the FBDialog (you will need the publish_stream permission in order to do this):

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   kAppID, @"app_id",
                                   @"http://developers.facebook.com/docs/reference/dialogs/", @"link",
                                   @"http://fbrell.com/f8.jpg", @"picture",
                                   @"Facebook Dialogs", @"name",
                                   @"Reference Documentation", @"caption",
                                   @"Using Dialogs to interact with users.", @"description",
                                   nil];
    [facebook requestWithGraphPath:@"/me/feed" andParams:params andHttpMethod:@"POST" andDelegate:self];

And just check in the delegate methods if the post was successfully posted:

(void)request:(FBRequest *)request didLoadRawResponse:(NSData *)data;
(void)request:(FBRequest *)request didFailWithError:(NSError *)error;


While technically you can do this via the graph api by publishing to /me/feed with publish_stream permissions, it is against the Facebook Platform Policy to prefill the message text with content that wasn't generated by the user. Facebook deprecated the message parameter from the dialog:

This field will be ignored on July 12, 2011 The message to prefill the text field that the user will type in. To be compliant with Facebook Platform Policies, your application may only set this field if the user manually generated the content earlier in the workflow. Most applications should not set this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜