简体   繁体   English

使用ShareKit将图像发布到Facebook

[英]Posting an image to Facebook with ShareKit

I've been successful so far in installing and getting ShareKit to post to Twitter, Email, and Photo Album. 到目前为止,我已经成功安装并让ShareKit发布到Twitter,电子邮件和相册。 Easy enough. 很简单。

However now I'm trying to get it to post to Facebook. 但是现在我试图将其发布到Facebook。 I'm simply using the default button through the actionsheet for Facebook. 我只是在Facebook操作表中使用默认按钮。

I have filled in App ID in the config of my ShareKit file. 我已经在ShareKit文件的配置中填写了App ID。 I have also added the CFBundleURLType stuff in the info.plist. 我还在info.plist中添加了CFBundleURLType内容。

The issue is when I hit the "Post to Facebook" button, I get redirected to my native Facebook app, I see a dialog box that says "Loading..." for 1 second, then I'm redirected back to my app. 问题是,当我单击“发布到Facebook”按钮时,我被重定向到我的本地Facebook应用程序,我看到一个对话框,显示“正在加载...”一秒钟,然后重定向到我的应用程序。 Upon first try (without app permissions), it'll ask me to allow the app, so that parts just fine. 第一次尝试(没有应用程序权限)时,它会要求我允许该应用程序,以便部分正常。 However it's not posting or asking me to post the image. 但是,这不是发布或要求我发布图像。

What am I missing? 我想念什么? Am I able to directly post images to FB? 我可以直接将图像发布到FB吗? Or does it have to be a URL first or something? 还是必须首先输入URL或其他内容? Also, am I suppose to enable SSO via the FB app settings? 另外,我是否想通过FB应用程序设置启用SSO? Thanks 谢谢

#import "SHK.h"
#import "SHKFacebook.h"

SHKItem *item = [SHKItem image:[UIImage imageNamed:@"yourImage.png"] title:imageTitle];
[SHKFacebook  shareItem:item];

My apologies, I should have read the documentation more thoroughly. 抱歉,我应该更全面地阅读文档。

Its step 7: https://github.com/ShareKit/ShareKit/wiki/Installing-sharekit 步骤7: https//github.com/ShareKit/ShareKit/wiki/Installing-sharekit

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM