Facebook (JavaScript) permission dialog for email - Error

蹲街弑〆低调 提交于 2019-12-26 03:52:05

问题


I am developing a Facebook application with FB JavaScript SDK. I need email permission on start of the application I am using OAuth Dialog. Here is the code:

<html xmlns:fb="https://www.facebook.com/2008/fbml">
  <body>
    <script src="http://connect.facebook.net/en_US/all.js"></script>
    <div id="fb-root"></div>
    <script>
      // assume we are already logged in
      FB.init({appId: '*************', xfbml: true, cookie: true, oauth: true});

      FB.login({
        scope: 'email,user_birthday',
      });
     </script>

     <a href="https://www.facebook.com/dialog/oauth/?
  scope=email,user_birthday&
  client_id=148244388606048&
  redirect_uri=https://apps.facebook.com/projectatestapp/test2.html&
  response_type=token"> test</a>
  </body>
</html>

But when I hit the URL https://apps.facebook.com/projectatestapp/test2.html, I see the test link. When I click at link some screen flashes and then I am directed to the Facebook page On which a big Facebook button is placed and when I click on that big fb icon button then I see the permission window

Now I dont know what I ma doing wrong as I dont want to see the big fb button in process of my application permission window. How to skip it?


回答1:


Add the target="_top" attribute to your link <a>, this way the link will open on the top window instead of within the iframe.



来源:https://stackoverflow.com/questions/7833875/facebook-javascript-permission-dialog-for-email-error

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