简体   繁体   English

如何在图谱API中获取Facebook朋友的电子邮件ID?

[英]How to get Facebook friend email id in graph API?

I want to get the email id of the my friends who have installed same application in his/her device as required by Facebook graph API version 2.0 or above But I am only getting name and id of the my friends, How can i get the email id of the friend ? 我想获取我的朋友的电子邮件ID,这些朋友已按照Facebook graph API版本2.0或更高版本的要求在他/她的设备中安装了相同的应用程序,但是我只得到我朋友的名称和ID,我如何获取电子邮件朋友的ID?

Any help would be appreciated. 任何帮助,将不胜感激。

I tried this code 我尝试了这段代码

new GraphRequest(login_result.getAccessToken(),"/me/friends",null,HttpMethod.GET,
            new GraphRequest.Callback() {
                public void onCompleted(GraphResponse response) {

                    Intent intent = new Intent(MainActivity.this, FriendsList.class);
                      try {
                        JSONArray rawName = response.getJSONObject().getJSONArray("data");
                        intent.putExtra("jsonData", rawName.toString());
                        intent.putExtra("accessToken", login_result.getAccessToken());
                        startActivity(intent);
                      } catch (JSONException e) {
                        e.printStackTrace();
                    }
                }
            }
     ).executeAsync();

response Like : 响应像:

{"data":[{"name":"Kishan Donga","id":"1104882236372503"}],"paging":{"cursors":{"before":"QVFIUjUzUWVQWndskfnbgtMXBCWHhSLTdCVW4xNmN3eUpTVlJaWFlyeG9leTJ1c0dIM2duZAU94bVdnTDh1c1RCOHBSaERUUXd1a1EwX2xOcU4zekl3aXBR","after":"QVFIUjUzUWVQWU42Q3pVZAHktMXBCWHhSLTdCVW4xNmN3eUpTVlJaWFlyeG9leTJ1c0dIM2duZAU94fbkdh1c1RCOHBSaERUUXd1a1EwX2xOcU4zekl3aXBR"}},"summary":{"total_count":3}}

Sorry friend you can't get the email address 抱歉,您无法获取电子邮件地址

Facebook's new API dosent allow you to take any information such as email,phone number etc Facebook的新API剂量允许您获取任何信息,例如电子邮件,电话号码等

The only chances are 1. me/taggable_friends - Where you can get an Id for tagging your friends and profile picture ( your friends must also use the same app) 2. me/invitable friends - This one is for games only to invite people into your game 唯一的机会是1. me / taggable_friends-您可以在其中获得用于标记朋友和个人资料图片的ID(您的朋友也必须使用同一应用程序)2. me / invitable朋友-此游戏仅用于邀请人们加入你的游戏

Here is the changelog 这是变更日志

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

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