简体   繁体   English

Facebook Graph API-版本2.0中的标记位置

[英]Facebook Graph API - Tagged Places in version 2.0

I used the Graph API with javascript to fetch all of my data contained locations in v1.0. 我将Graph API与javascript一起使用,以获取v1.0中所有数据包含的位置。 ( I used FB.api("/v1.0/me/locations", function (response) { ... }); ) (我使用了FB.api(“ / v1.0 / me / locations”,函数(响应){...});)

I know that the updated version is 2.2 and the "locations" node is replaced by "tagged_places" node in v2.0 and above. 我知道更新的版本是2.2,在v2.0及更高版本中,“位置”节点被“ tagged_places”节点取代。

I also use the Graph API Explorer to test my results. 我还使用Graph API Explorer来测试我的结果。 I try this, GET: /v2.2/me?fields=tagged_places and the results are exactly what I want. 我尝试使用GET:/v2.2/me?fields=tagged_places,结果正是我想要的。

However, in my js code, I try: FB.api("/v2.2/me?fields=tagged_places", function (response) { ... }); 但是,在我的js代码中,我尝试:FB.api(“ / v2.2 / me?fields = tagged_places”,function(response){...}); and there is NO any results! 没有任何结果!

Besides, I set version: 'v2.2' in Parse.FacebookUtils.init(); 此外,我在Parse.FacebookUtils.init();中设置了版本:“ v2.2”; I also ask the permissions :user_tagged_places,user_photos,user_status,user_friends,user_about_me,user_birthday,read_stream in Parse.FacebookUtils.logIn(); 我还要求在Parse.FacebookUtils.logIn();中的权限:user_tagged_places,user_photos,user_status,user_friends,user_about_me,user_birthday,read_stream。

I need almost all of the data of my checkins(aka locations in v1.0/tagged_places in v2.0) to add into my database. 我几乎需要将签到的所有数据(又称为v1.0中的位置/v2.0中的tagged_places)添加到数据库中。 I try to fetch /me/photos, but the results are not satisfied. 我尝试获取/ me / photos,但结果不令人满意。 So I still need to use maybe this: FB.api("/v2.2/me?fields=tagged_places", function (response) { ... }); 因此,我仍然需要使用以下代码:FB.api(“ / v2.2 / me?fields = tagged_places”,function(response){...});

So... can anyone help me? 所以...有人可以帮我吗? please.... 请....

I went through permissions in groups testing them out and I figured out what the problem was. 我分组测试了权限,然后找出了问题所在。 You need to have the permission of the item you were tagged in. So in my case I was tagged in photos, so I needed user_photos permission to gain access to user_tagged_places . 您需要具有标记您的项目的权限。因此,在我的情况下,我被标记在照片中,因此我需要user_photos权限才能访问user_tagged_places It actually creates quite an issue because you need to know how a user was tagged to retrieve their tagged_places. 实际上,这会带来很大的问题,因为您需要知道如何标记用户才能检索其agged_places。

If a user was tagged at a place in a post you need a different permission than if they were tagged in a photo. 如果在帖子的某个位置为用户添加了标签,则需要与在照片中添加标签的用户不同的权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM