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 6879251
In Process

The Archive Base Latest Questions

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

I have a facebook canvas application and I am using the latest version of

  • 0

I have a facebook canvas application and I am using the latest version of the PHP SDK.

I have a workflow that looks like this. User logs into facebook and clicks on the application from their list of apps.

User lands on a form page -> clicks submit -> user doesn’t see that it goes through the form process page and try’s to post to wall -> header redirect to invitation page.

The flow works because I have built in transparent error handling. However, there is no wall post during this first walk through of the flow. Repeat by clicking on facebook icon to go to user home page, click on the application link in the list of user apps.

User lands on a form page -> clicks submit -> user doesn’t see that it goes through the form process page and try’s to post to wall -> header redirect to invitation page.

This time and every time there after it works.

The error I receive during the first try is that the session access_token is invalid. Every single time afterwards, as long as the user does not logout it will work and I will never get a bad token.

ON THE FORM PROCESS PAGE WHERE THE WALL POST CODE IS:

$user = null;
require "/usr/home/app/www/fb/facebook.php";

//facebook application
$fbconfig['appid' ]     = "xxx";
$fbconfig['secret']     = "xxx";
$fbconfig['baseUrl']    =   "http://www.app.com/fb";
$fbconfig['appBaseUrl'] =   "http://apps.facebook.com/app";

// Create our Application instance.
$facebook = new Facebook(array(
  'appId'  => $fbconfig['appid'],
  'secret' => $fbconfig['secret'],
));

//session_write_close();
$user = $facebook->getUser();

    try {
        $publishStream = $facebook->api("/me/feed", 'post', array(
            'message' => "mess", 
            'link'    => 'http://apps.facebook.com/app',
            'picture' => 'http://images.app.com/img.jpg',
            'name'    => 'name',
            'description'=> 'des'
          )
        );
    } catch (FacebookApiException $e) {
        d($e);
    }
    header("Location: https://www.app.com/fb/invite.php");

This is the exact error truncated to leave out information that is erroneous:

FacebookApiException Object
(
    [result:protected] => Array
        (
            [error] => Array
                (
                    [message] => An active access token must be used to query information about the current user.
                    [type] => OAuthException
                )

        )
....
  • 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:49:23+00:00Added an answer on May 27, 2026 at 4:49 am

    So, after pounding my head against the wall for a week… I figured it out!
    I had added a script at the end of the first page to make the scroll reset.

    <script>
       FB.init({
         appId : 'appid',
         status : true,
         cookie : true,
         xfbml : true, 
       });
    </script>
    

    On the next page was the processing, that was not working correct until I reached the next page where the invitation screen was to appear. On that page was the FB.init,

    function callAppReq() {
       FB.init({
       appId  : 'appid',
       cookie: true,
       channelUrl : 'https://apps.facebook.com/app',
       oauth : true
    });
    

    After this page was loaded, every time thereafter the app worked correctly. I was scratching my head and couldn’t figure it out. Until I noticed, “oauth : true” was the ONLY thing going on that was NOT being called on the first page. So, in that dumb script that I needed to make the scroll bar go away I added “:oauth : true”…

    <script>
      FB.init({
        appId : 'appid',
        status : true,
        cookie : true,
        xfbml : true,
        oauth : true 
      });
    </script>
    

    Lo’ and behold, it works now. I am very upset that it was this code breaking things but VERY happy that I now have it fixed and understand what the issue was!!!

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

Sidebar

Related Questions

I am migrating my Facebook canvas application to using the new PHP SDK. However,
I've developed a Facebook application using the Facebook C# SDK. Interestingly, whenever the user
I have built an app using the facebook canvas method. This works in Mozilla
I have an issue with my Facebook canvas iframe application. I'm using sessions to
I have an iframe Facebook application (using Facebook's new JavaScript API) that needs to
I have a facebook game application that is released at facebook platform at the
I have an application in facebook platform (a trial application) and i am using
We currently have an iframe-based Facebook canvas application in the works. The canvas portion
I am in the process of devloping a facebook canvas application in php and
I have a facebook iframe application that is having trouble redirecting, I keep getting

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.