SLComposeViewController不会为SLServiceTypeFacebook设置initialText [英] SLComposeViewController won't set initialText for SLServiceTypeFacebook

查看:261
本文介绍了SLComposeViewController不会为SLServiceTypeFacebook设置initialText的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它似乎是社交框架中的一个错误,它不会为Facebook服务类型设置初始文本。这是我使用Swift实现的:

It seems as a bug in Social framework, it won't set the initial text for Facebook service type. This is my implementation using Swift:

let view = SLComposeViewController(forServiceType: SLServiceTypeFacebook)
if view.setInitialText("Some text") {
    NSLog("Success")
} else {
    NSLog("Failure")
}
view.addURL(NSURL(string: "https://google.ro"))
self.presentViewController(view, animated: true, completion: nil)

工作原理:


  • 网址显示Facebook和Twitter

  • initialText仅适用于Twitter

什么不起作用:


  • 即使上面的代码输出成功,初始文本也不会出现在Facebook上。

似乎Facebook真的不希望开发者设置初始值共享时的消息文本即使使用SDK也不可能。在我正在实施的应用程序中,我选择了应用程序的屏幕截图(上传为图像),以便用户在Facebook上分享他们的进度。

It seems like Facebook really doesn't want developers to set the initial text of a message when Sharing as that it's impossible even with their SDK. In the app I was implementing I've chosen screenshots from the app (uploaded as images) for letting the user share their progress on Facebook.

解决方案是使用适用于iOS的Facebook SDK,Facebook不再支持社交框架的功能。

The solution is to use the Facebook SDK for iOS, that feature of Social framework is not supported by Facebook anymore.

推荐答案

不是一个错误,Facebook不再允许它。

Not a bug, Facebook doesn't allow it anymore.

使用iOS共享表受Facebook平台政策的约束,包括部分2.3指出应用程序可能不会预填。在共享表的上下文中,这意味着应用程序可能不会预先填写共享表的initialText字段,其中包含之前使用该应用程序的人未输入的内容。

Use of the iOS share sheet is subject to Facebook Platform Policy, including section 2.3 which states that apps may not pre-fill. In the context of the share sheet, this means apps may not pre-fill the share sheet's initialText field with content that wasn't entered by people earlier in their use of the app.

这篇关于SLComposeViewController不会为SLServiceTypeFacebook设置initialText的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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