Facebook - “Cannot query users by their username” solution

匿名 (未验证) 提交于 2019-12-03 01:33:01

问题:

I am developing an android app. I was using a HttpURLConnection to get profile pictures of facebook users. The URL looks like this:

http://graph.facebook.com/?ids=username1,username2,username3&fields=picture&type=square 

But now, since v2.2 doesn't let me to get profile pictures of users who are not using my facebook app, it throws an error:

{ "error": {

  "message": "(#803) Cannot query users by their username (username1)",   "type": "OAuthException",   "code": 803    } } 

I am not interested in using "Facebook SDK for Android". Let's say I use a pop-up webview to authorize my facebook app. What url would let me do the same thing? Is there a simple solution like this:

graph.facebook.com/?app=APP-ID&ids=username1,username2&fields=picture

回答1:

/me endpoint.

Main rule: Forget about users who did not authorize your App, you are not supposed to get any data of those for privacy reason.



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