2010-05-14 65 views
2

我正在制作一款iphone游戏,因为我想在脸书上上传分数。我是新来面对书代码,我从github.com得到它的API。但是我不知道如何直接在登录帐户的墙上写信或发布我的消息,或者如何在Facebook上分享我的分数。我已完成登录部分。 任何人都可以帮助我吗?使用我的iphone应用程序在Facebook墙上写消息

回答

1

假设用户已经登录媒体链接中,你有一个vaild faceb0ok会话,你可以使用这样的事情,让你开始:

- (void) post { 
    postingDialog = [[[FBStreamDialog alloc] init] autorelease]; 
    postingDialog.delegate = self; 
    postingDialog.userMessagePrompt = @"Prompt the User:"; 

    NSString *name = @"Name of thing" 
    NSString *href = @"http://www.example.com" 

    NSString *caption = @"This is a caption" 
    NSString *description = @"This is a description"; 
    NSString *imageSource = @"http://example.com/1.png"; 
    NSString *imageHref = @"http://example.com/1.png"; 

    NSString *linkTitle = @"Link title"; 
    NSString *linkText = @"Text"; 
    NSString *linkHref = @"http://www.example.com/iphone"; 
    postingDialog.attachment = [NSString stringWithFormat: 
           @"{ \"name\":\"%@\"," 
           "\"href\":\"%@\"," 
           "\"caption\":\"%@\",\"description\":\"%@\"," 
           "\"media\":[{\"type\":\"image\"," 
           "\"src\":\"%@\"," 
           "\"href\":\"%@\"}]," 
           "\"properties\":{\"%@\":{\"text\":\"%@\",\"href\":\"%@\"}}}", name, href, caption, description, imageSource, imageHref, linkTitle, linkText, linkHref]; 
    [postingDialog show]; 
} 
+0

感谢Buddy ....现在让我来实现它。 – 2010-05-14 08:07:37

相关问题