简体   繁体   English

如何在Facebook照片上标记人物?

[英]How to tag people on facebook photos?

We have developed an app that creates a jpg of five friends as a result. 我们开发了一个应用程序,该应用程序创建了一个包含五个朋友的jpg图像。 We need the app to tag the people in the photo, but is not working. 我们需要该应用为照片中的人物添加标签,但无法正常工作。 The code seems to be valid as we don't get any errors. 该代码似乎有效,因为我们没有任何错误。

var tagdata= new Array;

tag1['tag_uid'] =Lamigos[0];
tag1['x'] =41;
tag1['y'] =373;

tag2['tag_uid'] =Lamigos[1];
tag2['x'] =172;
tag2['y'] =373;

tag3['tag_uid'] =Lamigos[2];
tag3['x'] =302;
tag3['y'] =373;

tag4['tag_uid'] =Lamigos[3];
tag4['x'] =100;
tag4['y'] =436;

tag5['tag_uid'] =Lamigos[4];
tag5['x'] =100;
tag5['y'] =567;


tag['data']=tagdata;
tagdata[0]=tag1;
tagdata[1]=tag2;
tagdata[2]=tag3;
tagdata[3]=tag4;
tagdata[4]=tag5;


   FB.api('/me/photos', 'post', {
    message:'Ahora puedes...',
    url:"http://www.xxxxxxx.com"+imgfin,
    tags:tag
   }, function(response){

      if (!response || response.error) {
        alert('Error al compartir tu lista');
      } else {
        vercapas(6);
  document.getElementById("simgfin").src=imgfin;
  document.getElementById("botcompartir").innerHTML="<a name='fb_share' type='button_count' href='http://www.facebook.com/sharer.php?u=http://www.xxxxxxxx.com" + imgfin + "&t=Estos son mis patas más patas'>Compartir</a>";
      }
   }); 

https://developers.facebook.com/docs/reference/api/user/#photos does not say that a tags parameter is accepted when posting to /me/photos. 在发布到/ me / photos时, https://developers.facebook.com/docs/reference/api/user/#photos没有说tags参数被接受。

I guess you have to add the tags after you posted the photo - see here: https://developers.facebook.com/docs/reference/api/photo/#tags 我猜您发布照片必须添加标签-参见此处: https//developers.facebook.com/docs/reference/api/photo/#tags

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

相关问题 如何获取除群组管理员以外的其他人上传的Facebook群组的照片? (通过JavaScript) - how to get photos of facebook group, as uploaded by people other than group admins? (via JavaScript) 想像我的网站一样在我的网站上向下显示人名或照片旁边的图像 - want to display images next to people's names or photos on my website down to down like facebook 如何使用Javascript将照片上传到Facebook? - How to upload photos to facebook using Javascript? Facebook - 获取页面的照片 - Facebook - Get photos of a page 如何从 Facebook Messenger 对话下载所有照片? JavaScript 原版 - How to download all photos from Facebook Messenger Conversation? JavaScript Vanilla 如何在翻转图像上显示信息,例如facebook人物标签 - How to display information on rollover image like facebook people taging Facebook应用程序是否可以告诉有多少人喜欢某个页面? - Is it possible for a Facebook app to tell how many people like a page? 如何实现Facebook的“在此处拖动链接/照片”? - How to implement Facebook's `Drag Links/Photos Here`? 如何通过JavaScript API在Facebook上发布多张照片? - How to post multiple photos on facebook via javascript api? 如何将我自己的私人 Facebook 照片导入我的网站? - How to import my own private facebook photos to my website?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM