Publishing a stream using the Facebook API in PHP? - facebook

I am currently developing a facebook app and I would like to now how to publish to the users wall...
Thanks alot

If your app is FBML i would suggest using the FBJS call:
Facebook.streamPublish
This is not a php solution but it is more reliable as it doesn't require the current user to have accepted facebook stream permissions for your app.
For iFrame apps/ FB Connect the following is available FB.Connect.streamPublish
Otherwise you can use the Stream.publish rest api call available in:
$facebook->api_client->stream_publish
although this requires accepted app permissions

Related

How to post on friend's wall using facebook API without logging in to facebook?

After latest Facebook API changes, is there any way to post on friend's wall, using authenticated access_token?
I have tried using Feed Dialog, but redirects to facebook login page. I want to bypass the login step.
Unfortunately not. From the Facebook API documentation on publishing:
"Note: If you are posting to a friend's timeline or wall, you must use the Feed Dialog."
Full details: https://developers.facebook.com/docs/reference/api/publishing/
No,You Cant
Currently, Facebook allows to post by two ways:
Using FacebookAPI
Using Facebook SDK (depends on your requirement)
And in both these methods its must that you should be an authorised user to perform the action, authentication is a must.So you can't do this without a login.
NB: As per the Facebook Developer docs, graph API no longer works .(But I would like to add on that many of the iOS apps which used this service are still functioning well). So, I prefer to use Facebook SDK.
Hope my answer is clear.

facebook API permissions

Just starting out with Facebook's API. I have a client that sends me the access_token after logging into to FB on iPhone. I am wondering where I would specify the permissions I need, for example to access email, or user's music data?
Is it via client using FBSession, or via Koala (ruby gem I use on server side with access_token to get user's info) or in Facebook's app settings page?
Thanks
If your user is logging in via an iOS app, you need to request them in the permissions parameter of FBSession. https://developers.facebook.com/docs/reference/ios/3.1/class/FBSession#permissions
Although I'm not a specialist in mobile development, so I cannot provide you with a functional example (or even properly explain how to do this) I have done a bit of browsing in the Facebook API section of the Developers website, and I believe that I have the answer to your questions. This will not only answer where, but it should also give you how, for many different purposes, there are different permissions that you must add, and this page gives you some idea of how to do all of them.
http://developers.facebook.com/docs/reference/login/

Facebook app writing comments?

I know it sounds weird but is there a way that an app (facebook app) that could write a comment on user's picture using Facebook API or anything?
Yes, a user can give an app permission to do so via the API.

Can you do a "stream.get" from Facebook Javascript SDK?

I am trying to build a cross browser extension with Crossrider which fetches the Facebook Stream and shows it on Google+.
Everything is set, the Facebook App, the connect itself, but the only missing piece in the puzzle is "stream.get" which I can't find how to call this API method with the JS SDK.
Is this possible at all ?
Thanks!
You can access https://graph.facebook.com/me/feed with an access token with the javascript api which is the graph replacement for stream.get. You could also run a FQL query against the stream table. Both I believe would need "read_stream" extended permission.

How to invite friends using facebook?

Note: dont think it as repeat of any other similar questions.
We have options to display the 'Invite Friends' dialog using Legacy FBML and javascript (it also uses FBML) and they are working fine.
As facebook states that these FBML are going to be deprecated, is there any other better to way to Invite/ send requests to friends to join an application ..
I'm in the initial phase of my db app development and dont want to use the to be deprecated stuffs.. Is there any option using GRAPH Api?
Edit: I'm using PHP SDK for this app development and is there any function we could use from that?
The requests dialog is currently the only non-deprecated method of inviting your friends to a Facebook application. I doubt there will be a graph api method to create them as it would seem to be too easy to abuse, but getting, clearing and deleting them are available with the graph api.