【问题标题】:Posting from my app in Facebook从我的应用在 Facebook 上发帖
【发布时间】:2012-11-05 22:10:17
【问题描述】:

我想更新我的 iOS 应用以利用 iOS 6 Facebook 集成。目前我使用 Facebook 对话。我喜欢向用户展示对话的方式,当它发布时,它有我的应用程序图标和一个小标签,上面写着“通过我的应用程序名称”链接到我的应用程序。

使用 iOS 6 Facebook 集成时,它会显示“通过 iOS”以及指向 Apple 网站的链接。有没有办法使用 iOS 6 的 Facebook 集成来实现相同类型的结果?

当前代码:

    NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               @"1234567890", @"app_id",
                               @"http://www.mywebsite.com/page5/page5.html", @"link",
                               picLink, @"picture",
                               countDownName, @"name",
                               @"My app name", @"caption",
                               @"For the iPhone and iPod Touch", @"description",
                               theMessage, @"message",
                               theFriendID, @"to",
                               @"Share on Facebook",  @"user_message_prompt",
                               nil];
[facebook dialog:@"feed" andParams:params andDelegate:self];

我的 iOS 6 代码(取自 Facebook 的示例代码)

    BOOL displayedNativeDialog = [FBNativeDialogs presentShareDialogModallyFrom:self
                                                                initialText:initialText
                                                                      image: [UIImage imageNamed: @"myImage.png"]
                                                                        url:url
                                                                    handler:nil];
if (!displayedNativeDialog) {

    [self performPublishAction:^{
        // otherwise fall back on a request for permissions and a direct post
        [FBRequestConnection startForPostStatusUpdate:message
                                    completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {

                                        [self showAlert:message result:result error:error];
                                        self.buttonPostStatus.enabled = YES;
                                    }];

        self.buttonPostStatus.enabled = NO;
    }];

【问题讨论】:

    标签: objective-c ios facebook ios6


    【解决方案1】:

    快速谷歌搜索显示以下教程:http://www.techotopia.com/index.php/IPhone_iOS_6_Facebook_and_Twitter_Integration_using_SLRequest#Facebook_Integration_using_SLRequest
    这似乎是一个很好的教程来做你正在寻找的东西。

    【讨论】:

      【解决方案2】:

      请尝试使用 here 提供的自定义 Facebook 撰写视图。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-04-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多