简体   繁体   English

Facebook在不要求身份验证的情况下获取用户名

[英]Facebook get username without requesting authentication

I have tried countless examples from all around.. Is there any real way to get the current users name in a fan page app using the JavaScript sdk without a pop up requesting authentication? 我已经尝试了无数个示例。.是否有任何真正的方法可以在不使用弹出窗口请求身份验证的情况下使用JavaScript sdk在风扇页面应用程序中获取当前用户名?

Here is my current JS: 这是我当前的JS:

window.fbAsyncInit = function() {
    FB.init({
        appId      : 'ID', // App ID
        channelUrl : 'url/channel.php', // Channel File
        status     : true, // check login status
        cookie     : true, // enable cookies to allow the server to access the session
        frictionlessRequests : true, // enable frictionless requests
        xfbml      : true  // parse XFBML
    });
    // Additional initialization code here

    FB.api('/me', function(response) {
    console.log("Welcome " + response.name);
});
};

// Load the JavaScript SDK Asynchronously
(function(d){
  var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
  js = d.createElement('script'); js.id = id; js.async = true;
  js.src = "//connect.facebook.net/en_US/all.js";
  d.getElementsByTagName('head')[0].appendChild(js);
}(document));

and then my PHP: 然后是我的PHP:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#">
<head>
  <meta charset="utf-8" />
  <title>View Source App</title>
   <script type="text/javascript" src="script/jquery.min.js"></script>
   <script type="text/javascript" src="script/script.js"></script>
</head>
<body>
    <div id="fb-root"></div>
  <div id="content">
  <h2>My First App</h2>
  <p>This is some text to make sure my app is working on Facebook</p>
  </div><!--content -->
</body>
</html>

Any Help Greatly Appreciated. 非常感谢任何帮助。

The short answer is no. 最简洁的答案是不。 You need permission to access any user data. 您需要访问任何用户数据的权限。

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

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