Use facebook sharer.php to share on a page wall - php

I want to link a user to make a share post on my fb company page without having to authenticate. Currently I can get them to share on their own wall with:
But I'm not sure how I can get this to share to a page's wall rather than their timeline.
I got somewhat close by using the dialog feature:
https://www.facebook.com/dialog/feed?app_id=xxx&link=xxx&picture=xxx&name=xxx&caption=xxx&description=xxx&redirect_uri=xxx
But that just showed it as a normal share but done "via appName", unless there is a step I'm missing to link my app to my facebook page?
Thank you!

Unfortunately, the sharer.php method is used only to share only on the user's timeline.
If you want to ask the user to post on a page's timeline, you have to create an app, ask the user to authenticate it and then use the Facebook APIs to post on their behalf. I guess that will be cumbersome in your case, so I would just suggest you redirect to the particular Facebook page.

You can't !
To publish on YOUR page timeline, users need to have the rights to do it (be admin, writer, ...) : it's a manual requirement on the Facebook interface.

Related

PHP Facebook : Allowing my website to post to user's Facebook page on behalf

I've looked at how I can post to my facebook page via my PHP website (as described in http://www.pontikis.net/blog/auto_post_on_facebook_with_php).
Now, this might be quite similar, what is the best way to allow another user to grant my website to post to his/her facebook page on behalf?
You need the permissions scope publish_actions and then use /page/feed. More information at the Graph API documentation, here.

in my php page, I need the visitor facebook information.. possible?

I see some website detect my facebook name and offer a like button so I can the page I'm visiting. Can that be done in php? if not, how then?
Thanks
Facebook offers widgets for that matter, you can copy paste the code from the Facebook developer site: https://developers.facebook.com/docs/reference/plugins/like/
To get a visitor's name, tou could use Facebook javascript API https://developers.facebook.com/docs/reference/javascript/. You'll need to create an application and the user will need to authorize it before you're able to get any information. There are obvious security reasons why you can't get your visitor's name.

Application able to post on user's Wall

I have a Fan Page and I need to post something on users Wall after clicking Like Button. Moreover I need to display different content for users who "Like" the page and for users who don't "Like" the page. Is there an application like "Static iFrame Tab" which already solves this? If not, then how to post something on users Wall? I downloaded the facebook.php file, but I haven't managed to find the required function there.
The user's 'like' status can relatively easily be returned by decoding the signed request sent by Facebook to the page.
I've built a simple fan/like gate that is available over on GitHub - it might help you get up and running.
With regards to posting to the user's wall. I would suggest using the Javascript SDK and reading the FB.ui documentation over on Facebook.

Provide link/Redirect after a 'Like' or 'Share' on Facebook or a 'Share' on Twitter

basically what I want to do is forward people to a download link once they either 'like' my page on Facebook or post a link of the page to their profile (whatever is easier) and something similar for Twitter.
I have seen some bands do this when promoting a free download — to download the new song you must post this to your profile etc.
Anybody know how I could go about this? (This isn't a 'can you do it for me' question, I just need a point in the right direction regarding API's or any examples)
Thanks.
Look at the edge.create event in Facebook javascript SDK. This hits after you've liked something.
You can also create a Facebook app and check the likes of a Facebook user with their permission on the server side using FQL (user_likes).
You can create a Twitter app and read the last few tweets to check if there is a tweet containing your text/link/whatever programatically.
Notice that all of these can be deleted easily after you've redirected them. You cannot avoid that.
This Page has the like button attributes. Look under FAQ and you will see "How do I know when a user clicks a Like button?"

post on facebook page wall as facebook admin through facebook php api

I would like to post feed to facebook page wall as page admin. I can publish post to facebook wall with publish_stream from fb php api, but it is just as a normal facebook user. May I know how can I do likewise as a page admin (meaning that the post publish from facebook page and not from other fb user on the page wall)? Thank you. It is urgent.
Regards,
Benjamin
Just come across this question. This was a know bug within the Graph API which has now been addressed. There is an additional permission named manage_pages which has been added to the list of extended permissions. If you request this permission as part of your authentication process then you should be up and running.
Further information can be found in the documentation and the bug fix that has been put in place.
it is mentioned here.
If you want to post to Page Wall as Page, use page id in the UID not in the target_id.
Pages can't post to other pages.
If you want to post to Page Wall as Application, use page id in the target_id, and the app id in the UID here

Categories