![](/img/trans.png)
[英]How to publish from iOS application to facebook wall without user amending message
[英]Is it possible to publish a story on user's wall without making an app on facebook?
我正在使用iphone应用程序。 它是一个基于导航的应用。 在每个DetailVew中都有一个按钮,用于在用户的Facebook墙上发布一些信息。 它将是链接和一些信息。 我怎样才能做到这一点? 在developer.facebook.com中,他们已经解释了执行此操作的步骤,但在那些steos中他们需要facebook app id。 我没有任何应用程序在Facebook上对我的iPhone应用程序。 是否可以在没有Facebook应用程序的情况下在Facebook墙上发布故事? 感谢名单
是的,这是可能的。 如果你想以自定义格式输出故事,你仍然需要创建一个Facebook应用程序,但如果你只想输出标题和故事,可能有链接或图片,则没有必要。 我使用的代码看起来像这样:
SBJSON *jsonWriter = [[SBJSON new] autorelease];
NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
[name stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""], @"name",
[description stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""], @"description",
[url stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""], @"href", nil];
NSString *attachmentStr = [jsonWriter stringWithObject:attachment];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"XXX", @"api_key",
@"Share on Facebook", @"user_message_prompt",
attachmentStr, @"attachment",
nil];
[facebook dialog:@"stream.publish" andParams:params andDelegate:self];
这是使用较新的Facebook iOS API而不是较旧的FacebookConnect API。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.