Erve1879
Erve1879

Reputation: 845

Django and Post to Facebook (no authentication)

OK, I need some help understanding the process behind Facebook's website integration process and how I can integrate it into my web app....

In its most basic form, my site stores and displays users' comments about products (there's more to it than that, but that's all that's relevant for this question). What I'd like to do is allow them to post that comment, together with the name of the product (and my site), to their Facebook wall by clicking a button.

I do not need the users to log in to my site at all, either with Facebook or any other authentication system and the Post to Facebook part is optional.

Obviously if they decide they do want to post their comment to Facebook, then they'll need to login, but I'd rather temporarily take them away from the page to login, post and then be brought back to my site.

What I need to know is how much of Facebook's APIs, Open Graph and Auth systems do I actually need to integrate?

I had hoped that I might be able to generate a simple link to Facebook with their comment embedded as a POST element...?

I'd be really grateful if someone could point me in the right direction!!

(P.S. I need a similar solution for Twitter, but I think that's easier!?!)

Upvotes: 1

Views: 660

Answers (1)

C3roe
C3roe

Reputation: 96383

The Feed Dialog doesn’t allow including of a pre-set message any more, so you’d have to make that post via the Graph API if you want to pre-fill the message (and even then, you should only do so, if you’ve given the user the possibility to edit the pre-filled message first).

See here for how to make a post on a user’s behalf via Graph API, https://developers.facebook.com/docs/reference/api/user/#posts

You can do that all client-side, if you embed the JavaScript SDK into your page.

You need to set up an app on FB, then have the user connect to it (using FB.login), ask for the necessary permission (publish_stream) while doing so, and after successful login use FB.api to make the Graph API call.

Upvotes: 2

Related Questions