Ios SLServiceTypeFacebook setInitialText不工作

Ios SLServiceTypeFacebook setInitialText不工作,ios,social-framework,Ios,Social Framework,我正在尝试在IOS 8.3上与SLServiceTypeFacebook共享Facebook上的文本。但弹出文本框显示为空。我希望它与文本一起显示。下面你可以看到我使用的代码 if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) { SLComposeViewController *controller = [SLComposeViewController composeVi

我正在尝试在IOS 8.3上与SLServiceTypeFacebook共享Facebook上的文本。但弹出文本框显示为空。我希望它与文本一起显示。下面你可以看到我使用的代码

 if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) 
 {
       SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];

       [controller setInitialText:@"First post from my iPhone app"];
       [self presentViewController:controller animated:YES completion:Nil];
  }

安装最新的Facebook应用程序更新(v29)似乎有问题。删除它“修复”了问题

更新(2015年6月3日)

嗯。Facebook的新政策似乎规定,通过
setInitialText:
预先填充消息是违反预先填充规则的

因此,我想从现在起,共享内容的唯一方法就是
FBSDKShareDialog


我一定很喜欢Facebook的效率。我在这方面有点晚了,但可能会帮助别人

#import <FBSDKShareKit/FBSDKShareKit.h>

FBSDKShareLinkContent  *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = self.urlForSocialMedia;
content.contentDescription = self.textForFB;
content.contentTitle = @"Results.";

[FBSDKShareDialog showFromViewController:self
                             withContent:content
                                delegate:self];
#导入
FBSDKShareLinkContent*内容=[[FBSDKShareLinkContent alloc]init];
content.contentURL=self.urlForSocialMedia;
content.contentDescription=self.textForFB;
content.contentTitle=@“结果”;
[FBSDKShareDialog showFromViewController:self
内容:内容
代表:自我];

在设置InitialText之前在本测试之前添加
。代码如下。它对我有用

SLComposeViewController *mySLComposerSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];

    [mySLComposerSheet setInitialText:@"#myInitialTextIsHere"];
    [mySLComposerSheet addURL:[NSURL URLWithString:strURL]];

    [mySLComposerSheet setCompletionHandler:^(SLComposeViewControllerResult result) {

        switch (result) {
            case SLComposeViewControllerResultCancelled:
                NSLog(@"Post Canceled");
                break;
            case SLComposeViewControllerResultDone:
                NSLog(@"Post Sucessful");
                break;

            default:
                break;
        }
    }];

    [self presentViewController:mySLComposerSheet animated:YES completion:nil];

setInitialText
是否返回
YES
NO
?这是iOS 8.3上的一个已知问题:“Greg Pierce(@agiletortoise)4/27/15,上午11:22 UIKit各位:iOS 8.3上新出现的问题[SLComposeViewController setInitialText]. rdar://20709403 openradar.appspot.com/radar?id=50611…@deanware你能发送这个链接吗?你建议我等待新的iOS版本吗?openradar:安装第三方应用程序(Facebook)似乎很奇怪,可能是重复的可以破坏本机SLComposeViewController。但我可以确认这确实发生了,即使是最新的应用程序更新(v30)。同样的问题也在Facebook v31中产生。请给我一些建议。我不认为苹果会反对SLComposeViewController。一些合适的解决方案还在等待。我个人不想实现FBSDKShareDialog,因为它会花费很多时间,比如配置、代码初始化、集成安装SDK等。SLCompose…Controller只需要4-5行代码。安装了新iOS 9的Apple有新的Facebook SDK,其中setInitialText已被弃用是正确的。Instagram也是如此。您不能通过编程方式在这两个应用中添加预定义的注释。setInitialText对于iOS 9不被弃用,因为它仍然适用于Twitter和其他社会框架服务。至于“苹果。有新的Facebook sdk。,这也不是真的。他们仍然在使用社会框架。这是“突然的”“Facebook的改变也给我带来了不便。”编辑:使用Facebook自己的SDK的个人体验并不有趣。。。如果你只需要共享支持,我不建议你使用它。为什么你创建一个对话框,然后不使用它?!?最后,您正在使用FBSDKShareDialog showFromViewController创建和显示对话框。我想FBSDKShareDialog应该只是在最后的对话框。这篇文章开头的三个点将让我获得几乎与创建应用程序本身所花费的时间相同的时间!