iphone:FBConnect 自动发布到用户墙

发布于 2024-08-30 12:09:18 字数 59 浏览 4 评论 0原文

我想从我的 iPhone 应用程序自动发布到用户墙(没有“发布”“跳过”对话框)。我怎样才能做到这一点?

i want to auto post to a user wall from my iphone applications ( without that "publish" "skip" dialog box ). how i can do that ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

音盲 2024-09-06 12:09:18

应该在实现 FBSessionDelegateFBRequestDelegate 的类中调用以下内容:

Facebook *_facebook = [[Facebook alloc] initWithAppId:kAppId];
NSArray *_permissions =  [[NSArray arrayWithObjects:
                           @"read_stream", @"offline_access",nil] retain];
[_facebook authorize:_permissions delegate:self];

这就是对 fb post 的调用(应该在同一个类中使用):

NSString *message = @"This is the message I want to post";
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               message, @"message",
                               nil];

[_facebook requestWithMethodName:@"stream.publish"
                       andParams:params
                   andHttpMethod:@"POST"
                     andDelegate:self];

如果您想在其他用户的墙上发布消息,您应该在您的 params 字典中包含“uid”参数。请参阅http://developers.facebook.com/docs/reference/rest /stream.publish/

PS iPhone 中有所有必要的示例Facebook connect SDK示例代码,所以请不要害怕调查一点点;)

the following should be called in the class that implements FBSessionDelegate and FBRequestDelegate:

Facebook *_facebook = [[Facebook alloc] initWithAppId:kAppId];
NSArray *_permissions =  [[NSArray arrayWithObjects:
                           @"read_stream", @"offline_access",nil] retain];
[_facebook authorize:_permissions delegate:self];

And that is the call for fb post (should be used in the same class):

NSString *message = @"This is the message I want to post";
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               message, @"message",
                               nil];

[_facebook requestWithMethodName:@"stream.publish"
                       andParams:params
                   andHttpMethod:@"POST"
                     andDelegate:self];

If you want to post a message on the wall of other user you should include "uid" parameter in your params dictionary. Please consult http://developers.facebook.com/docs/reference/rest/stream.publish/

P.S. There are all the necessary examples in the iPhone Facebook connect SDK sample code, so please do not afraid to investigate just a little bit ;)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文