Rob*_*Rob 10 facebook ios ios6
使用时SLComposeViewController
,如果图像和URL都存在,我会注意到发布到Facebook时的好奇行为.具体来说,如果您同时拥有图像和URL,则URL会显示在Facebook帖子的正文中SLComposeViewController
,initialText
如果我执行以下操作,则会立即显示在该帖子的正文中:
SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
NSString *text = @"This is a test Facebook post with SLComposeViewController.";
NSURL *url = [NSURL URLWithString:@"http://http://stackoverflow.com/questions/12503287/tutorial-for-slcomposeviewcontroller-sharing"];
UIImage *image = ...;
[controller setInitialText:text];
[controller addURL:url];
[controller addImage:image];
[self presentViewController:controller animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
这显然是一个麻烦,因为如果URL很长,初始文本被推离视图的可见部分,SLComposeViewController
我只看到URL的后一部分:
如果我重复这个过程,这次不将图像添加到帖子中,URL的文本根本不会显示在正文中(即使它在网上正确显示).
底线,仅当有图像和 URL时,URL才显示在帖子的正文中.当我使用时,我看到了相同的模式FBNativeDialogs
.
有没有办法阻止这种行为SLComposeViewController
,以便我可以将图像和URL连接到Facebook帖子而不会将用户暴露给网站的冗长,丑陋的URL?显然,我可以使用任何非SLComposeViewController
解决方案(例如,设计我自己的用户界面来撰写Facebook帖子,使用Facebook已弃用的Feed对话框等).只是想知道我是否忽略了一些明显的SLComposeViewController
解决方案.
新的对话框似乎是围绕您设计的,将大部分共享数据作为标签提供给所提供链接指向的网站.像这样:
标题:
<title>TITLE</title>
Run Code Online (Sandbox Code Playgroud)
描述:
<meta name="description" content="DESCRIPTION">
Run Code Online (Sandbox Code Playgroud)
图片:
<meta property="og:image" content="IMAGE_URL">
Run Code Online (Sandbox Code Playgroud)
应用ID:
<meta property="fb:app_id" content="APP_ID">
Run Code Online (Sandbox Code Playgroud)
这样您只需提供初始文本和URL.您可以查看官方Youtube应用程序如何以Facebook共享为例.
归档时间: |
|
查看次数: |
6784 次 |
最近记录: |