Wednesday, February 10, 2010

How to call stream_publish on a child Facebook app using the Facebook PHP API


$facebook = new Facebook($childApiKey, $sessionSecret);
$facebook->api_client->session_key = $sessionKey;
$facebook->api_client->use_session_secret($sessionSecret);
$facebook->api_client->stream_publish('Hello!');

where $sessionKey and $sessionSecret appear in $_COOKIE['[apiKey]_session_key'] and $_COOKIE['[apiKey]_ss'].

Labels: ,

4 Comments:

Blogger takah0918 said...

I get the latest php SDK from github, but I couldn't find "api_client" method.
Are there any idea to update child application ?

1:08 AM  
Blogger Jonathan said...

Unfortunately the new Facebook SDK does not seem to have support for child applications.

10:06 AM  
Blogger takah0918 said...

Thank you for your reply.

I got other library from code.google.com.

I'm concerned about whether facebook deprecate the idea for child application through the old php SDK or not in the near future.
Or already announced officially about that ?

10:56 AM  
Blogger Jonathan said...

I am not sure if there is an official announcement about it, but I would recommend preparing for support for this feature to end sometime in the future, just in case.

7:47 PM  

Post a Comment

<< Home