- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在将图像从我的 Canvas 应用程序发布到用户的相册时遇到了问题。根据 Facebook 文档:
In order to publish a photo to a user’s album, you must have the publish_stream permission. With that granted, you can upload a photo by issuing an HTTP POST request with the photo content and an optional description to one these to Graph API connections:
- https://graph.facebook.com/USER_ID/photos - The photo will be published to an album created for your app. We automatically create an album for your app if it does not already exist. All photos uploaded this way will then be added to this same album.
- https://graph.facebook.com/ALBUM_ID/photos - The photo will be published to a specific, existing photo album, represented by the ALBUM_ID.
所以,从第一步开始,如果我上传这样的图片...
Facebook.api("me/photos",imagePostCallback,{message:"",image:myImageBitmap,fileName:''},URLRequestMethod.POST);
...那么我可以期望它将我的图像放在以我的应用程序命名的相册中,必要时它会创建该相册?
不是这样。
当相册不存在时实际发生的是上传的图像被推送到任何其他存在的方便相册中,这些相册通常用于(并由)其他应用程序。这有点痛苦。
到目前为止,我已经尝试了以下方法:
Facebook.api
上传图像将会失败用户交互的直接结果。所以现在我有点难住了。显然我不可能让我的应用程序将图像发布到竞争对手的相册,但目前我能看到的唯一选择是有效地让用户在必须创建相册时提交他们的图像两次。有什么想法吗?
最佳答案
我猜你的参数中需要 access_token :) 在用户的 facebook 上发布内容时,你总是需要这个(在获取信息时并不总是必需的)。获取accesstoken的方式如下图:)
public function post():void
{
var _params:Object = new Object();
_params.access_token = Facebook.getSession().accessToken;
_params.message = "";
_params.image = myImageBitmap;
_params.fileName = "";
Facebook.api("me/photos", imagePostCallback, _params, URLRequestMethod.POST);
}
还请确保您在请求应用权限时拥有正确的权限。
编辑
好的,所以我有点错过了您的编辑 ;) 应该可以创建您自己的相册。看看这个 graph api 的 php 代码。该代码还应该能够解析为 AS3。
http://developers.facebook.com/blog/post/498/
EDIT2
好吧,我做了更多的挖掘(似乎很有趣)。这实际上应该在使用图形 API 时有效。
FB.api('/me/albums', albumCreateCallback, {name: 'name of the album', message: 'description of the album'}, URLRequestMethod.POST);
当您随后调用另一个 api 调用以在 albumCreateCallback 中上传您的图片时,它应该可以工作并上传您的图片(根据我的发现)。
关于actionscript-3 - 使用 AS3 API 将图像发布到 Facebook 相册,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6611685/
这就是我现在拥有的,它适用于单个图像。 curl -vH "Authorization: Client-ID 3e7a4deb7ac67da" -F image=@/path/to/image htt
我有一套 PDF 相册模板(它们在文本和照片应该放置的地方有空白方 block )。我的需求是使用这些模板来生成实际的相册。 我的计划是使用 iText 和 Java。我会向应用程序发送一组要使用的所
我有一个包含多个字段的表单,用户需要通过附加图像数量的选项来感受: '; $num++; } ?> 提交后,它会在数据库中创建一个名为“album”的表,如下所示: fun
我创建了一个 Facebook 相册并拥有相册 ID。我可以使用/photos API 将照片上传到相册。但我无法使用类似/videos API 的方式上传视频。我收到错误消息: “(#200)用户没
我的代码是这样的: oldPicker = [[UIImagePickerController alloc] init]; if([UIImagePickerController isSourceTy
我正在实现一个 iPhone 应用程序,我必须从 Facebook 相册中检索图像并将这些照片显示为应用程序中的图库。我有这个链接 http://www.facebook.com/media/set/
我可以通过将数据发布到 使用 facebook graph api 创建相册 http://graph.facebook.com/ALBUM_ID/albums 它返回一个 id,这不是相册 id。
我是 Swift 的新手,我正在尝试使用 fetchAssetCollections 创建一个简单地返回屏幕截图相册中照片数量的函数 我有 func getNumScreenshots() -> In
我在使用权限上传到特定 Facebook 相册时遇到问题。 我被设置为特定 Facebook 页面的管理员,但是每当我尝试上传照片时,我似乎无法获得执行此操作的权限。 我得到的错误是: Fatal e
对于相册,我看到大多数人使用 3 个表: 专辑相片相册。 但是,如果我查看像 facebook 这样的网站,这个模式将不起作用(如果我理解正确的话),因为我的个人资料相册和一般相册中可能有一张照片,但
我正在编写一个程序来在本地备份我的 Google 相册库,上周代码运行良好,但在过去的几天里,我反复从 API 客户端收到错误消息,说“photoslibrary v1”不存在在 Google 的 A
似乎大多数方法都指向UIImageWriteToSavedPhotosAlbum(),但是在iOS 6及更高版本中,您需要用户权限才能写入相机胶卷,因此,如果他们说“no”,我希望能够调用代码。 是否
我想用Java制作简单的相册。要做到这一点,我认为这将是使用网格布局协调图片的最简单方法。 我有图片的缓冲图像,我正在尝试使用以下代码将它们添加到网格布局中, BufferedImage a
我正在制作一个数据采集应用程序,它可以让医生拍摄皮肤病的照片以供以后用于人工智能/机器学习目的,所以我的应用程序将有一个拍照按钮来拍照,假设有 4 个标签或按钮命名疾病(水痘,湿疹等)一旦用户拍照,他
我有一个 nodejs (+express + mongodb,gridstore) 后端,想上传一张照片到 facebook 相册。 我遇到了两种方法。第一个 ( https://developer
我正在尝试使用 Google Photos API增量上传一个非常大的本地照片库。 一切正常,但在上传大约 1.2GB 后,请求开始被拒绝并显示以下消息: Insufficient tokens fo
从youtube到google +很容易。但另一方面 我有一个Google Plus个人资料和与其链接的YouTube channel 。但是-从youtube-我看不到我的google +相册中的视
我正在尝试在 iPhone 应用程序中获取 facebook 用户的任何专辑。 这是我正在使用的 fql 查询 NSString *query = [NSString stringWithFormat
我正在尝试利用 Google Photos 幻灯片构建一个由 Raspberry Pi 驱动的数字相册。理想情况下,我希望能够通过 Selenium 自动化登录过程,然后使用 BeautifulSou
我正在尝试使用 Picasa Web Albums API 重构 Java 应用程序使用新的 Google 相册 API。 在 Picasa API 中,您有 PhotoEntry 对象,它代表上传的
我是一名优秀的程序员,十分优秀!