通过Facebook GraphAPI标记照片 [英] Tagging Photos via Facebook GraphAPI

查看:172
本文介绍了通过Facebook GraphAPI标记照片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Facebook最近在Graph API中添加了照片标记功能:
http:/ /developers.facebook.com/blog/post/509/



我在iPhone上使用FbConnect上传图片并标记我的页面。
所以,我的第一个电话是:

  NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
self.imageToPost ,@picture,
@My caption!,@name,@tags,
nil];

[self.theFacebook requestWithGraphPath:@me / photos
andParams:params
andHttpMethod:@POST
andDelegate:self];

正确返回:
{
id = 2092859844825;
}



然后我再打个电话:

  NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
FACEBOOK_PAGE_ID,@to,
@160,@x,
@240,@y,
nil];

[self.theFacebook requestWithGraphPath:[NSString stringWithFormat:@%@ / tags,photoId]
andParams:params
andHttpMethod:@POST
andDelegate :自];

然后我得到:
{contents =OAuthException}
{contents =(#121)无效的照片ID }



但是我期望有什么ID?
在GET方法中提交相同的请求,它不会给出错误,所以我认为id是正确的。任何想法?

解决方案

你设置了哪些权限?检查你是否有 user_photos 权限


Facebook recently added photo-tagging capabilities to its Graph API: http://developers.facebook.com/blog/post/509/

I am using FbConnect on iPhone to upload a picture and tag my page inside it. So, my first call is:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   self.imageToPost, @"picture",
                                   @"My caption!", @"name", @"tags",
                                   nil];

    [self.theFacebook requestWithGraphPath:@"me/photos"
                                 andParams:params
                             andHttpMethod:@"POST"
                               andDelegate:self];

This correctly returns: { id = 2092859844825; }

Then I make another call:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   FACEBOOK_PAGE_ID,@"to", 
                                   @"160",@"x", 
                                   @"240",@"y", 
                                   nil];

    [self.theFacebook requestWithGraphPath:[NSString stringWithFormat:@"%@/tags",photoId]
                                 andParams:params
                             andHttpMethod:@"POST"
                               andDelegate:self];

Then I get: {contents = "OAuthException"} {contents = "(#121) Invalid photo id"}

But what ID does it expect from me? Submitting the same request in GET method, it doesn't give the error, so I think the id is correct. Any ideas??

解决方案

What permissions do you have set? Check you have the user_photos permission

这篇关于通过Facebook GraphAPI标记照片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆