在iPhone上登录后,在Facebook上发布postToWall [英] postToWall on facebook After login in iphone
问题描述
有人对如何在墙上张贴墙有想法吗? iphone中的登录按钮后添加了facebook. 我必须发布默认的图像和文本. 如果是,则必须在哪个fb类中编写.i具有适用于Facebook的最新SDK. 谢谢
Does anybody have idea about how to post a wall on facebook after login button in iphone. i have to post default image and text. If yes in which fb class it have to write .i have latest sdk for facebook. Thanks
推荐答案
登录后使用FBConnect库,您可以使用以下方法在用户墙上发布
using FBConnect library after login you can use the following method to post on the users wall
Facebook *facebook = [[[UIApplication sharedApplication] delegate] facebook];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"###yourAPIKeY###", @"api_key",
@"###Your Message###", @"message",
@"###link if you want###", @"link",
@"### a picture if you want###", @"picture",
@"###name of your fb app###", @"name",
@"###Description###", @"description",
nil];
[facebook requestWithGraphPath:@"me/feed"
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
如果您希望它在用户登录后立即发生,则可以通过以下方法实现:
If you want it to happen right after the user logged in it should be implemented in the following method:
-(void) fbDidLogin
{
}
请务必注意,您需要向用户询问publish_stream
权限
be sure to note that you need to ask from the user publish_stream
permissions
这篇关于在iPhone上登录后,在Facebook上发布postToWall的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!