iFrame App. Permissions Request?

后端 未结 2 1397
独厮守ぢ
独厮守ぢ 2021-01-26 08:50

I want to request permissions when the user first clicks my iFrame Facebook application. The problem is the examples I have seen force the user to click a button to load the htt

相关标签:
2条回答
  • 2021-01-26 09:08

    I do something like this in one of my iframe applications (I've simplified the actual code for this example)

    $fbSession = $facebook->getSession();
    if ( $fbSession )
    {
      $url = $facebook->getLoginUrl( array(
          'canvas'    => 1
        , 'fbconnect' => 0
        , 'req_perms' => 'list,of,perms'
        , 'display'   => 'page'
      ) );
      include( 'redirect.php' );
      exit;
    }
    

    Then, redirect.php

    <script type="text/javascript">
      top.location.href = '<?php echo $url; ?>';
    </script>
    <p>
    Not being redirected? <a href="<?php echo $url; ?>" target="_top">Click Here.</a>
    </p>
    
    0 讨论(0)
  • 2021-01-26 09:15

    no need to complicate: target="_top" is the answer!

    Best!

    m

    0 讨论(0)
提交回复
热议问题