I'm a little bit confused right now. But I think I'm making it more complicated than it is actually :) It's about posting out of a Facebook app. I have a Facebook page and I'm about to develop an app which should be integrated in that page. The purpose is to make the page more attractive and memorable. The app is about the content the page contributes. The problem is (I've alredy read some questions about that, but still I don't get it), if I post on a users' wall, I post as the app and not as the page.
It is possible to post on a users' wall after requesting their permission (publish_stream) and also on to post on a page the user administrates (manage_page). Am I right so far? But is there a way to post as my page within my app? Can I post as a one of my app users on a wall with any permission? I thought about if I start to use my app as my page, maybe then I can post as my page?
It may sound a bit awkward, but I hope anyone can help me. At least to tell me that I'm dreaming of something which wouldn't be possible anytime (because of security issues i.e.).
Thanks!
You cannot post as your page, users in your application can post to their walls or your applications page. In fact when building your app, if you are using Facebook as a page and try to refresh your App from your URL you will get errors... if you need help starting your app with the functions i have mentioned, visit this link: http://www.epixseo.com/index.php/facebook-php-3-3-1-and-javascript-sdk-graph-api-tutorial/
Related
A team of some friends and I have come up with an app/product idea that we have been working on. I have to be vague on exactly what the details are, but hopefully I can explain it well enough to have the questions we have answered.
First, we have a web server with a database - we have developed all of the code for that in PHP. Each user will have a device which when an action is performed on the device, it sends a message to our server, and the PHP code on our server handles the message and stores the sent data in the appropriate fields in our database.
We want to run this through Facebook - we have an app and a Facebook page created for this. The idea is that when a user performs an action on his or her device and the message is sent to the server, the PHP code will automatically make a post on the Facebook page on the user’s behalf (not on the Page’s behalf).
Between all of us on working on this project, we have spent many days and many hours trying to figure out how to make the automatic post to the page. It’s extremely difficult googling this topic since all of the various examples are using different versions of the Facebook SDK (we are using the latest). There are lots of somewhat similar type questions/examples, but we can't find one that answers specifically what we are asking. In fact, we aren’t even sure that anybody but an ‘admin’ can post on a Facebook page with the new SDK, any longer. I do see this link in the Facebook developer section, https://developers.facebook.com/docs/graph-api/reference/v2.5/page/feed, where it says under the Publishing section:
Permissions
A user access token with publish_actions permission can be used to publish new posts on behalf of that person. Posts will appear in the voice of the user.
So, it sounds as if a user can post to the Facebook page if it is given an access token with publish_actions permission, yet we can’t find any example of code of this actually being done. Could anybody explain how to do the automatic posting to the page on a user’s behalf (hopefully, using PHP, since that is the language we are using on the server side), or at least point us to a good example? We are all experienced developers, but this is the first time any of us has done anything with Facebook development. So we certainly aren’t amateurs, but with Facebook development, we are. We may be overlooking something obvious, but after seeing so many links, my mind is jello.
A summary of our questions:
1. Can it even be done with the latest Facebook SDK that a post can be made to a Facebook Page for our product on the user’s behalf? (to be clear, we are talking about the Facebook Page we created for our app, not a user's page)
2. If so, what specific permissions do we need to give the user, just the publish_actions one? We don’t want to give the user too much permission to be able to screw up our page, of course.
3. Can this be done automatically with PHP from the server?
Any help would be GREATLY appreciated!
I'm trying to develop a Facebook App that works using Unity3D as front-end but using a PHP Web server to do the Facebook request saving the private key there.
I tested various things like uploading photos and comments an then it get reflected the new App Insigths of the App as Stories Published.
The thing I can't achieve is to see the Likes and Comments of those Stories, it remains 0.
¿There is something that I don't understand about the Likes/Comments there, or I'm doing something bad?
Thank you all.
P.D: Sorry about my English ^^'
Edit:
I can't provide example code of what i've done but I can explain it.
Actually my front-end do get requests to a backend PHP server that do the requests to Facebook.
When a user want to log in the server return the login url in a string and the front-end launches a Internet navigator (in my case is Google Chrome).
The callback url given to Facebook go to a site that closes automatically the navigator and putting in first plane my front-end.
From there you can do the request to the back-end to publish stories in Facebook and then log-out
Actually this is what my application do and it works. The only problem is that the comments and likes that those stories got are not reflected in the App Insights section.
I found this, but it is kinda confusing, and doesn't answer the question for me. I'm looking to upload images from my website to a Facebook page (my code works for users pages, not company pages), if there is a way to do it without having to make an application, I'd like that, but from what I've seen, that's not possible.
My code is here: http://pastebin.com/wBp1AQwG
Your link doesn't appear to go anywhere useful, I'm afraid.
Nonetheless, I'm guessing your problem here is that you need to use a Page access token not a user access token to publish to a page rather than a user feed.
See the section on Page Access Tokens at https://developers.facebook.com/docs/reference/api/page/
I've figured it out, here is a basic outline of the process for posting an image to an album that you own on a fanpage.
Get user authenticated
Get users accounts
Get albums, or create them
Post to the id of the album (ALBUM_ID/photos) with the image
It's pretty simple once I figured out the basics of the api.
When posting to the page wall (feed) through my application, under the post contents facebook adds '20 minutes ago *via my_app*'. This is a problem for my company, since they don't want the fans knowing the posting is done through an application, thus losing the personal touch.
Is there any way to lose the '*via my_ap*p' part of the post? These are some of the things I have tried:
I have given every possible permission on the page admin user, including 'manage_pages'
Have tried with the token returned from graph api me/accounts for that page / Impersonating pages
Please tell me, short of making a bot to do the whole thing, is there any way to do this through the facebook api.
Thank you for any help you can provide.
If you don't want the people to see which company you are, then Facebook is the wrong platform for you!
I'm pretty sure, you also would violate the terms of Facebook (Developer).
See what your competitors are doing. The largest company in this business has named their app "Publisher". When users click on this a page will open up that doesn't say anything about who created the app - actually it doesn't say anything at all. You could also use the name "Publisher" for your Facebook publishing app - in Facebook app names don't have to be unique.
I'm developing this Facebook Application and I was wondering if it's possible (and how) to programmatically, through the Facebook PHP Graph API, press some 'Like' button on some page?
Of course, this is optional on my application... I'm still not ready to really explain what application I'm doing, but it would be interesting to code such a feature.
Is it possible somehow?
By your description it sounds like you're trying to get a user to like something without the users knowingly clicking a like-button. This sort of interaction is not condoned by Facebook, I think. There are various black-hatty ways to accomplish this though, one fairly elaborate one is descriped here: http://www.liquidrhymes.com/2010/08/25/smoking-hot-bartender-is-some-smoking-hot-facebook-spam/
UPDATE Sorry, I might be wrong. If you get stream_publish extended permissions from the user, you might be able to like posts on their behalf by doing a POST to /POST_ID/likes. See Publishing to Facebook in http://developers.facebook.com/docs/api
You cannot do this. Facebok wont let you do a POST to /POST_ID/likes, you can only do a get request to retrieve their likes. What you are trying to do is a violation of facebook's TOS. I would suggest just adding a like button and "forcing" them to like before they continue with your application. However, in my opinion even that is kind of silly because they can instantly go unlike it after they have used your application.
i was looking for the same thing, but not to force a user into liking something, but actually for their own protection.
here is where i come from: on a web site (maybe on multiple pages) there is an "I Like" button, implemented as described by facebook.
each time a user goes to that page, the browser will make a request to facebook, throught the iframe that contains the button, providing all the info that we are used to from a web server log file.
if the user has in the past logged in facebook and not cleared the cache. the request will also contain the cookie indentifying the facebook user.
so even more then analytics, facebook know all about the user activity on those pages.
so i wanted the user to only give this info when they decide to.
my solution was to have a button (as graphic only) on the page. when the user clicks it a new frame should open and only there the facebook code should be executed.
obviously on the new frame i could not put the normal "i like" code, since that would require a 2nd click for the user. at this point i would need the "programmatically clicking of the i like button".
it is not an opengraph solution, but it works: the frame just does a redirect to
http://www.facebook.com/share.php?u=URL