Tagging Photos via Facebook GraphAPI

橙三吉。 提交于 2019-12-24 19:15:42

问题


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??


回答1:


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



来源:https://stackoverflow.com/questions/6225009/tagging-photos-via-facebook-graphapi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!