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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:46:40+00:00 2026-05-15T18:46:40+00:00

I am migrating my Facebook canvas application to using the new PHP SDK. However,

  • 0

I am migrating my Facebook canvas application to using the new PHP SDK. However, I am having a problem getting the JavaScript SDK to work too.

I’m wanting to take advantage of methods such as stream.publish in the JavaScript SDK. Unfortunately I’ve not been able to get anything to work thus far. I have the following in the header of my application’s index.php file:

<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_GB/all.js"></script>
<script>
    FB.init({appId: *);
    FB.ui({
        method: 'stream.publish',
        message: 'Check out this great app!'
    });
</script>

My application ID has been removed for obvious reasons.

Where I’d expect the above to give the user a prompt to publish a message to their stream, it’s not. Can I even use the new JavaScript SDK in Facebook canvas applications? Or is it reserved for iFrame applications and utilizing Facebook Connect on websites only?

  • 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-15T18:46:41+00:00Added an answer on May 15, 2026 at 6:46 pm

    I’ve solved it using the following:

    <?php
    $attachment = array(
        'name' => 'Attachment name here',
        'href' => 'Attachment URL here',
        'media' => array(array(
            'type' => 'image',
            'src'  => 'Image URL here',
            'href' => 'Link URL here',
        )),
        'caption' => 'Caption here',
    );
    $action_links = array(array(
        'text' => 'Action link text',
        'href' => 'Action link href',
    ));
    ?>
    <script type="text/javascript">
    <!--
    var message = "Your status update here...";
    var attachment = <?php echo json_encode($attachment); ?>;
    var action_links = <?php echo json_encode($action_links); ?>;
    Facebook.streamPublish(message, attachment, action_links);
    //-->
    </script>
    

    Thanks to all that answered.

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

Sidebar

Related Questions

I'm currently working with the JavaScript SDK for Facebook. The application was based on
I am migrating my old FB app to the new graph API using the
I use the some WinForm client sample from Problems when migrating from Facebook SDK
I have a facebook app developed in plain PHP, I'm migrating the app to
While migrating a program from windows in linux I encountered a problem using the
Today I created new application on facebook for my site, but it's giving me
I'm thinking about migrating my code toward using C++11-style lambdas instead of having bind
Migrating a legacy application from WebSphere v.6 to WebSphere v.8. The application's web.xml only
Background: Migrating an application from ball of mud to MVC. Many classes contain HTML
I'm migrating my application from Rails 3.0.12 to 3.2. I use the active_record_store to

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.