- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我将 facebook 集成到我的一个 iOS 应用程序中,它共享报价。但问题是,当在我的时间线上引用帖子时,我的 friend 无法分享“喜欢”和“评论”。我想分享请看附件截图那么最好的解决方案是我的 FB 应用程序有问题,还是我必须在 iOS 中为此编写代码。
提前致谢
最佳答案
我查看了您的屏幕截图。基本上,这看起来像 fb“赞帖子”。因为没有人不能分享这篇文章。我建议您使用最新的 ios fb sdk 3.1.1,然后将该 FB sdk 与您的 ios 应用程序集成。然后使用下面的代码
对于 ios 6 及更高版本,使用 ios 6 原生 fb post 方法:
if(NSClassFromString(@"SLComposeViewController") != nil) {
UIApplication* app = [UIApplication sharedApplication];
app.networkActivityIndicatorVisible = NO;
SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
SLComposeViewControllerCompletionHandler myBlock = ^(SLComposeViewControllerResult result){
if (result == SLComposeViewControllerResultCancelled) {
NSLog(@"\nCancelled");
} else
{
NSLog(@"\nDone");
}
[controller dismissViewControllerAnimated:YES completion:Nil];
};
controller.completionHandler =myBlock;
[controller setInitialText:FB_POST_FEED_INITIAL_TEXT_MSG];
[controller addURL:[NSURL URLWithString:BITLY_VIEW_LINK]]; // youtube video link
[self presentViewController:controller animated:YES completion:Nil];
}
否则使用这个FB sdk方法:
[FBSession openActiveSessionWithReadPermissions:nil
allowLoginUI:YES
completionHandler:
^(FBSession *session,
FBSessionState state, NSError *error) {
switch (state) {
case FBSessionStateOpen:
//first shows the hud view then initiating the post message feed process
[self postFBMessageOnUserWall];
break;
case FBSessionStateClosed:
//need to handle
break;
case FBSessionStateClosedLoginFailed:
//need to handle
break;
default:
break;
}
}];
-(void)postFBMessageOnUserWall {
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
FB_POST_FEED_INITIAL_TEXT_MSG, @"name", BITLY_VIEW_LINK, @"link", nil];
[FBRequestConnection
startWithGraphPath:@"me/feed"
parameters:params
HTTPMethod:@"POST"
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error) {
//show the alert says that message successfully posted in your wall
[self performSelectorOnMainThread:@selector(showAlertFromMainThread:) withObject:error waitUntilDone:NO];
NSLog(@"\n\nfb post feed error status = %@", error);
}];
}
关于iphone - 在我的 iPhone 中集成了 Facebook 应用程序,但是当我在我的墙上发帖时,我的 friend 无法分享我该怎么办?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10749928/
这个问题在这里已经有了答案: Syntax error due to using a reserved word as a table or column name in MySQL (1 个回答)
关闭。此题需要details or clarity 。目前不接受答案。 想要改进这个问题吗?通过 editing this post 添加详细信息并澄清问题. 已关闭 8 年前。 Improve th
这就是我所做的 在 Facebook 上创建了一个应用 安装了满足所有要求的 FB SDK 通过登录按钮登录用户 现在我正在尝试使用此处提供的来自此威胁的代码进行发布 How to Post to F
我正在尝试用 YouTube 视频发帖。每个帖子都有一个 YouTube 视频链接,就像这样: { title: "Some video", link: "http://www.youtu
我可以使用 HttpClinet 类获取网页,如下所示: HttpClient client = new HttpClient(); HttpResponseMessage response = aw
我正在尝试使用 Alamofire 将某些内容发布到我的服务器,但我无法让它工作。在 Postman 中,它看起来像这样: 这是我的代码: func uploadDish(dish:Dish, com
我正在尝试使用 Facebook SDK 从我的应用程序中将帖子集成到用户墙上。简单发布没问题,但我正在尝试添加用户实际所在的位置(在时间之后的帖子底部)。 有什么想法吗?感谢您的帮助! 最佳答案 这
是否可以使用当前的 G+ API 发布到用户墙上?我只能找到有关获取信息的信息。似乎目前不支持发布任何数据。 最佳答案 信息来自 https://developers.google.com/+/api
我正在遵循使用 Open Graph Beta 的官方指南,并且能够使用我的用户名发布操作(我是该应用程序的开发者)。但是,当我尝试使用其中一个测试用户时,我收到以下错误消息: { "error
有人可以就如何使用 Jekyll 处理我的投资组合页面的结构提供一些指导或建议吗?我的帖子通过混合变量和帖子内容来处理大部分工作。我在呈现帖子页面时遇到问题,因为 HTML 和 markdown 标记
我正在尝试将以下 curl 命令行自动化到 Ruby Curb 中: curl -H "Content-Type:application/json" -X POST -d \ '{"approval
我的部分 View : @model Alina_2017.Models.DropDownModel Groepen @using (Html.BeginForm("Sel
我的部分 View : @model Alina_2017.Models.DropDownModel Groepen @using (Html.BeginForm("Sel
我想发布一个使用 jQuery ajax 的文章,无需重新加载页面,它在 Chrome 中工作正常,但在 Firefox 6.0 中不起作用。下面是我的代码 fun
实际上客户端驻留在 tomcat 8080 中,而 REST API 驻留在 9090 中。当移动到更高的环境时,URL 会有所不同。我没有看到使用 httpasyncclient 对 REST AP
我想通过 Javascript 通过扩展发布到 Google+ 用户流。我知道 Google+ 还没有 API,但我已经看到这是用 PHP api 完成的。有没有人知道从哪里开始实现这个?我不需要任何
在他/她使用 wordpress api 给我他的登录信息后,我如何远程发帖到用户的博客?我需要使用什么方法,它应该有什么参数等等?示例代码会很棒。 我更愿意使用 XML-RPC api,但其他的也可
我正在尝试使用 Perl 的 Net::Blogger 自动发布到博客,但它一直返回 false 并且不发布。我的代码的主要部分如下所示: use Net::Blogger; my $blogger
我一直在寻找从 wp7 应用程序发布到 twitter 的解决方案,但发现关于此事的资源非常有限。一切似乎都使用不同的编程语言(例如 PHP)或平台(ASP.NET),或者缺少文档。 这些问题不适用于
我正在尝试创建一个网络服务来使用 Google Plus API。我正在用 Java 编写它,但是我无法弄清楚我需要哪些文件以及如何使用 Java 发布到 Google+ 群组 如果您有任何站内信息,
我是一名优秀的程序员,十分优秀!