简体   繁体   English

如何在Android中从Facebook获取用户电子邮件ID和用户名

[英]How to get user email id , user name from Facebook in android

I want to get user email id, user name from Facebook without using Facebook SDK. 我想从Facebook获取用户电子邮件ID,用户名,而不使用Facebook SDK。 Actually i did Facebook and Twitter sharing using Nostra library . 实际上,我使用Nostra库进行了Facebook和Twitter共享。 But now i need Facebook and Twitter user email id, user name , etc. . 但是现在我需要Facebook和Twitter用户的电子邮件ID,用户名等。 If i use Facebook and Twitter SDK , my code will be useless because i used Nostra library . 如果我使用Facebook和Twitter SDK,我的代码将无用,因为我使用了Nostra库。

Now in this condition , what should i do ?. 现在在这种情况下,我该怎么办? If there are any way to solve this problem , 如果有什么办法可以解决这个问题,

Please help me .
Thanks in advance .

要获取电子邮件,可以使用user.getProperty(“ email”)。toString();

If you want to access data which is restricted, you'll need to gather the appropriate permissions by building a manual login flow for your Facebook app. 如果要访问受限制的数据,则需要通过为Facebook应用程序构建手动登录流程来收集适当的权限。 Have a look here: 在这里看看:

https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/v2.0 https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/v2.0

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

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