[英]How to post on Facebook wall without opening Dialog?
I am trying to integrate facebook in my app. 我正在尝试将Facebook集成到我的应用程序中。 I had done code for login and trying to post on my wall but I don't need the facebook dialog. 我已经完成了登录代码并尝试在墙上发布,但是我不需要facebook对话框。 I want my own. 我想要我自己的。 after googling I found some code but its not working. 谷歌搜索后,我发现了一些代码,但无法正常工作。 It is not giving any error but not posting any thing... 它没有给出任何错误但没有发布任何东西...
Here I am using is : 我在这里使用的是:
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"Facebook developer Test Message",@"message",
@"Test it!",@"name",
nil];
Facebook *fb = [[Facebook alloc] init];
[fb requestWithGraphPath:@"me/feed" // or use page ID instead of 'me'
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
Its not working.. 它不起作用..
FBStreamDialog *dialog = [[[FBStreamDialog alloc] init]
autorelease];
dialog.userMessagePrompt = @"Enter your message:";
dialog.attachment = [NSString
stringWithFormat:@"{\"name\":\"Facebook Connect for iPhone\",\"href\":\"http://developers.facebook.com/connect.phptab=iphone\",\"caption\":\"Caption\", \"description\":\"Description\",\"media\":[{\"type\":\"image\",\"src\":\"http://img40.yfrog.com/img40/5914/iphoneconnectbtn.jpg\",\"href\":\"http://developers.facebook.com/connect.php?tab=iphone/\"}],\"properties\":{\"another link\":{\"text\":\"Facebook home page\",\"href\":\"http://www.facebook.com\"}}}"];
[dialog show];
This opens a dialog and ask me to type message and when I clicks It post the Data on my wall. 这将打开一个对话框,并要求我键入消息,然后单击“将数据发布到我的墙上”。
I Had refferes following links for this 我为此推荐了以下链接
http://forum.developers.facebook.net/viewtopic.php?id=79466 http://forum.developers.facebook.net/viewtopic.php?id=79466
Please tell me where I am doing mistake. 请告诉我我在哪里做错了。
Thanks 谢谢
hi i think you can do this and can solve your problem 嗨,我认为您可以做到,并且可以解决您的问题
NSString *str=@"Your String to post";
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
str,@"message",
@"Test it!",@"name",
nil];
Facebook *fb = [[Facebook alloc] init];
[fb requestWithGraphPath:@"me/feed" // or use page ID instead of 'me'
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.