大佬教程收集整理的这篇文章主要介绍了iphone – 使用批处理请求在Facebook上上传多张照片,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一些解决方案,上传多张照片在Facebook通过这个Facebook graph API.
码:
NSString *jsonrequest1 = @"{ \"method\": \"POST\",\"relative_url\": \"me/photos\",\"body\": \"Hello 1\",\"attached_files\": \"file1\" }"; NSString *jsonrequest2 = @"{ \"method\": \"POST\",\"body\": \"Hello 2\",\"attached_files\": \"file2\" }"; NSString *jsonrequestsArray = [NSString StringWithFormat:@"[ %@,%@ ]",jsonrequest1,jsonrequest2]; NSMutableDictionary *params = [NSMutableDictionary DictionaryWithObjectsAndKeys:jsonrequestsArray,@"batch",nil]; [params setObject:UIImagePNGRepresentation(self.image1) forKey:@"file1"]; [params setObject:UIImagePNGRepresentation(self.image@R_674_11121@orKey:@"file2"]; [objFacebook requestWithGraPHPath:@"me" andParams:params andhttpR_401_11845@ethod:@"POST" andDelegate:self];
结果字典在 – (void)request:(FBrequest *)request didLoad:(id)result
( { body = "{\"error\":0,\"error_description\":\"File file1 has not been attached\"}"; code = 400; headers = ( { name = "http/1.1"; value = "400 Bad request"; },{ name = "Content-Type"; value = "text/javascript; charset=UTF-8"; } ); },{ body = "{\"error\":0,\"error_description\":\"File file2 has not been attached\"}"; code = 400; headers = ( { name = "http/1.1"; value = "400 Bad request"; },{ name = "Content-Type"; value = "text/javascript; charset=UTF-8"; } ); } )
我不知道这个文件如何附加..任何人都可以帮助我找出这个问题。
我的代码有任何变化,那么请让我知道。
提前致谢…
以上是大佬教程为你收集整理的iphone – 使用批处理请求在Facebook上上传多张照片全部内容,希望文章能够帮你解决iphone – 使用批处理请求在Facebook上上传多张照片所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。