Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6880319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:57:31+00:00 2026-05-27T04:57:31+00:00

After the FBML problems I switched to iFrame apps. All well for now except

  • 0

After the FBML problems I switched to iFrame apps. All well for now except that 2 things:

1) if I did not entered in the app for a few hours and I try to enter, sometimes it gives me the error page that my server did not responded. It shows the Faceboob page with iFrame inside showing the error. After 1 or 2 refreshes it’s working fine.

2) I implemented the new SDK with login like this

$facebook = new Facebook(array(
  'appId'  => $fbID,
  'secret' => $fbSecret,
  'cookie' => true,
));

$user = $facebook->getUser();

$loginUrl = $facebook->getLoginUrl();   

if ($user) {
  try {
    $user_profile = $facebook->api('/me');
  } catch (FacebookApiException $e) {
    d($e); 
    $user = null;
  }
}

if (!$user) {
    echo "<script type='text/javascript'>
                 top.location.href = '$loginUrl';
          </script>";
    exit;
}

The problem is my first redirect, when user enters for the first time. It redirects to my server URL not my Facebook app URL. If I try to put it like this:

$loginUrl = $facebook->getLoginUrl(
    array(
        'redirect_uri' => 'http://apps.facebook.com/xxx/'
    )
);  

the login is entering in an infinite loop.

Any help solving this two problems is welcome:-)

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:57:32+00:00Added an answer on May 27, 2026 at 4:57 am

    Darko4spain when the user is redirected back to your site, you can detect if is in iframe with javascript and send them back. I have same issue with my app. This is not a pretty fix but it works.


    if (window!=window.top) { 
    //FB.Canvas.setAutoResize();
    setTimeout("FB.Canvas.setAutoGrow()", 1400);
    }else {
    top.location.href = 'https://apps.facebook.com/AnotherFeed/?ref=redirect#comments';
    }
    

    example: https://anotherfeed.com/plugins/index.php will redirect you back to my canvas if you are not in the canvas.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

after I did some research on the subject, I found that Windows Live stopped
After being told by at least 10 people on SO that version control was
After hours of debugging, it appears to me that in FireFox, the innerHTML of
After I was convinced that labeled breaks/continues are a total nono over here ,
After a extensive debugging session I found that the problem was that I called
We have a Face book page.We add a custom FBML tab.Now we want to
After receiving push notification app icon not display badge. In setting notification is on,
After using the following code no errors are shown, but my database is not
After nearly 10 hours of searching and trying different things I couldn't figure out,
I am trying to disable all the input buttons on a page after I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.