简体   繁体   English

facebook权限对话框php-sdk在iframe应用程序中着色

[英]facebook permission dialog php-sdk shaded inside iframe application

I'am having trouble with facebook php-sdk new api, permission window. 我遇到了facebook php-sdk new api,权限窗口的问题。 I am using facebook connect inside the facebook iframe application. 我在facebook iframe应用程序中使用facebook connect。

e-profpy app @ Facebook e-profpy app @ Facebook

When I try to login with following url, login windows laying out well inside facebook application but permission diolog is being overlayed by shaded screen. 当我尝试使用以下网址登录时,登录窗口在Facebook应用程序内部布局良好,但权限diolog正在被阴影屏幕覆盖。

What can cause this ? 是什么导致这个? I am using only php no javascript facebook api. 我只使用php没有javascript facebook api。

Thanks 谢谢

I had the same problem. 我有同样的问题。 To fix it, you'll need to use JS to redirect the user to the FB authorization page, then let FB pass the authenticated user back to your app page. 要修复它,您需要使用JS将用户重定向到FB授权页面,然后让FB将经过身份验证的用户传递回您的应用页面。 You don't need to use the JS API for this. 您不需要为此使用JS API。

  • First, check the FB applications settings and make sure that your "Post-Authorize Redirect URL" is set to your Canvas Page URL. 首先,检查FB应用程序设置,并确保将“授权后重定向URL”设置为Canvas页面URL。 (eg http://apps.facebook.com/[YOUR APP]/) (例如http://apps.facebook.com/ [您的 APP] /)

  • Then handle your authentication like this: 然后像这样处理您的身份验证:

    $session = $facebook->getSession(); $ session = $ facebook-> getSession(); $me = null; $ me = null; if ($session){ try { $uid = $facebook->getUser(); if($ session){try {$ uid = $ facebook-> getUser(); $me = $facebook->api('/me'); $ me = $ facebook-> api('/ me'); } catch (FacebookApiException $e) { error_log($e); } catch(FacebookApiException $ e){error_log($ e); } } }}

    if ($me) { $logoutUrl = $facebook->getLogoutUrl(); if($ me){$ logoutUrl = $ facebook-> getLogoutUrl(); } else { $loginUrl = $facebook->getLoginUrl( array('next'=>" http://apps.facebook.com/[YOUR APP]/")); } else {$ loginUrl = $ facebook-> getLoginUrl(array('next'=>“ http://apps.facebook.com/ [您的 APP] /”)); } }

    if (!$me){ print("[html][head]"); if(!$ me){print(“[html] [head]”);
    print("[script type=\\"text/javascript\\"]function redirect(){ top.location.href = \\""); print(“[script type = \\”text / javascript \\“] function redirect(){top.location.href = \\”“);
    print($loginUrl); 打印($ loginUrl);
    print("\\"; }[/script][/head]"); print(“\\”;} [/ script] [/ head]“);
    print("[body onload=\\"redirect();\\"]Please wait...[/body][/html]"); print(“[body onload = \\”redirect(); \\“]请等待... [/ body] [/ html]”); exit(); 出口(); } }

( i dunno how to make tags appear here, so i used square brackets. you'll want to replace those) (我不知道如何在这里制作标签,所以我使用方括号。你会想要替换那些)

There is a better solution to work on iframe base canvas app. 有一个更好的解决方案来处理iframe基础画布应用程序。 Check the following tutorial http://www.phpfour.com/blog/2010/05/quick-start-on-new-facebook-php-sdk-iframe-based/#content 请查看以下教程http://www.phpfour.com/blog/2010/05/quick-start-on-new-facebook-php-sdk-iframe-based/#content

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

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