iOS6 facebook整合(图像文章) [英] iOS6 facebook integration (image post)

查看:115
本文介绍了iOS6 facebook整合(图像文章)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想在我的应用程序中添加Facebook功能。我想通过我的应用程序在Facebook上添加图像。

I just want to add facebook functionality in my app. i want to add image on facebook through my app.

是否有适用于iOS6的示例。

Is there any sample available for iOS6.

推荐答案

官方文档, SLComposeViewController类参考

Visit this official documentation, SLComposeViewController Class Reference.

苹果已经创建了一个社交框架。 SLComposeViewController 是将处理所有社交互动请求的控制器。

Apple has created a social framework. SLComposeViewController is the controller which will handle all the request for social interaction.

if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook])
{
    SLComposeViewController *objSLComposeViewController = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
    SLComposeViewControllerCompletionHandler __block completionHandler=^(SLComposeViewControllerResult result)
    {
        [objSLComposeViewController dismissViewControllerAnimated:YES completion:nil];
        switch(result)
        {
            case SLComposeViewControllerResultCancelled:
            default:
                break;
            case SLComposeViewControllerResultDone:
                break;
        }
    }
    [objSLComposeViewController addImage:yourImage];
    [objSLComposeViewController setInitialText:@"YourInitialText"];
    [objSLComposeViewController addURL:[NSURL URLWithString:@"YourURL"]];
    [objSLComposeViewController setCompletionHandler:completionHandler];
    [self presentModalviewController:objSLComposeViewController animated:YES completion:nil];
}

我希望这有助于。

这篇关于iOS6 facebook整合(图像文章)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆