如何从iPhone应用程序中将多张照片上传到Facebook? [英] How to upload multiple photos to Facebook from within iPhone app?
问题描述
有没有API调用,我们可以用来从iPhone应用程序将多张照片上传到Facebook?到目前为止,我们一次只能做一次。
您将需要直接使用Facebook Connect API:iOS SDK不会公开此类功能。 >
你应该看看 Graph Photo API ,它建议此URL上传图像(不要忘记请求 publish_stream
凭据):
POST https://graph.facebook.com/USER_ID/photos
message = [
source = [图像数据]
place = [可选图像的位置]
随着iOS Facebook Connect SDK给我们这个电话,给你一个 Facebook
实例叫 facebook
和 UIImage
实例调用图像
:
[facebook requestWithMethodName:@/ USER_ID / photos
andParams:[NSDictionary dictionaryWithObjectsAndKeys:
UIImageJPEGRepresentation(image,0.7),@source,
@我的小狗太可爱了!!!,@message,
nil]
和HttpMethod:@POST
andDelegate:self];
您可以将此电话与批次请求同时上传多张照片。
Is there an API call that we can use to upload multiple photos to Facebook from iPhone app? So far we can do only one at a time.
You will need to use the Facebook Connect API directly: the iOS SDK does not expose this kind of functionality.
You should have a look at the Publishing section of the Graph Photo API which suggests this URL to upload an image (don't forget to ask for the publish_stream
credential):
POST https://graph.facebook.com/USER_ID/photos
message=[optional description]
source=[the image's data]
place=[optional image's location]
With the iOS Facebook Connect SDK that would give us this call, given you have a Facebook
instance called facebook
and a UIImage
instance called image
:
[facebook requestWithMethodName:@"/USER_ID/photos"
andParams:[NSDictionary dictionaryWithObjectsAndKeys:
UIImageJPEGRepresentation(image, 0.7), @"source",
@"My puppy is so cute!!!", @"message",
nil]
andHttpMethod:@"POST"
andDelegate:self];
You can couple this call with batch requests to upload multiple pictures simultaneously.
这篇关于如何从iPhone应用程序中将多张照片上传到Facebook?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!