Facebook API: create event using Facebook's form - facebook

I've done my searching for the answer to this but it remains unclear. This could be a simple "possible" or "not possible" answer.
I have a site I'm creating that uses Facebook Connect (may or may not be relevant). I would like users to be able to create Facebook events based on events posted on this site. I'm familiar with the Facebook API and realize I could make my own form that would allows users to create a Facebook event... but I don't really think I want to do that work.
Is there a way I can point a user to Facebook's "create event" form but simply pre-populate some of the fields to help them along?
For example, say I wrote post about a free concert and had a button that said "make this an event on Facebook!". I would like that to link back to the fB event form with a title "Reggae Night 2010" and then from there the user could go on and create the event as they normally would. I don't see the point in doing my own form, validation, etc.
Thanks!

Firstly, obviously have a FB login enabled page and/or when the click your site's "click here to create event in Facebook" button, then have it check for whether the user is already logged into FB. Then use javascript to prepopulate the fields on the form on this page...
http://www.facebook.com/events/create.php
...with the info from your site's event.
That should be it!
-Flak
EDIT: spankmaster79 - yes, that's what I said above.... have your code CHECK for WHETHER you're ALREADY LOGGED INTO FB first. (Please remove the -1, I'd appreciate it)

Related

How to create a Facebook "challenge a friend" event?

We have an application that lets users challenge their friends in various challenges. Right now we issue the challenge by posting a message to their friends wall. This functionality will be removed in february so we need to find another way of issuing the challenge. What are the alternatives available?
We want the friend to get notified that the challenge has taken place and that some kind of story is generated on some wall.
We have looked at open graph actions and the mention tagging there must be done by the user herself so we can't use that to mention the selected friend. And we cant use action tagging since this is not an event that has or is happening.
It might be possible to use an open graph action referencing the built in "Profile (External)" object, but that seems to be rather messy - we just want to reference the facebook user. And we don't know if the friend would get notified of this - probably not.
The story could be published to the users own wall, but we really want the friend to be mentioned and notified.
It seems to be a rather standard use case for applications - does facebook provide this functionality anymore?
Edit: I'm thinking that maybe invoking the javascript feed dialog with a from and to setting might work. Then the user can also write a personal message for the challenge, and it should show up at both walls?
The best way to do this is by using a request: https://developers.facebook.com/docs/requests/
Of course it will not be public then, but after all it´s a direct action between the user and his friend and other users might see this as spam.
The other way (and the second best, i guess) is to use mention tagging:
https://developers.facebook.com/docs/technical-guides/opengraph/mention-tagging/
You could use Open Graph to post a dynamic link, if the mentioned user clicks on it > challenge accepted. If any other user clicks on it, he will just get redirected to the main app page.
...another idea, which is probably the very best:
use the request dialog for the challenge
after sending the request, let the user (if he wants to) post a message about it on his wall (feed dialog)

Facebook web app... can I change something on my own website in response to a user "liking" my app?

I want a sorta basic answer on this one, just a little guidance but nothing fancy... I just want to know what direction to go in to make it so I update a specific users account (on my personal database) in response to the user clicking the facebook "like" button on my site.
So.. if someone was registered on my site, but not yet clicked FACEBOOK LIKE through my site, when they clicked it can I edit my database, specifically the entry of the user who clicked like?
Hope that makes sense?
Thanks
About as close as you can get is if you call the method for /USER_ID/likes/PAGE_ID the facebook API will return either an empty array, or some data on the page. An empty array means they have not liked it.
That will tell you if they like your facebook page, not necessarily your URL.
Here is a SO answer with some javascript/css black magic for if you really need to know if a user likes a particular URL or not.
Facebook how to check if user has liked page and show content?

Implementing a Facebook Page Like with the Facebook Registration Plugin

I have read through the documentation on how to set up the Facebook Registration Plugin. In reading I saw that there are what facebook calls named fields and custom fields. What I am looking for is a check box that says "Like us on facebook". If that is clicked and the form is submitted the user auto likes our page.
I would think that there would be a field in named fields area that does this.
Some of the research I have done suggests that forcing an auto like on a user is black hat and could result in the deletion of your facebook page. This registration plugin seems like a good way to get the user to opt in to facebook marketing. Yes I could auto like them on submit if the box is checked but then how would facebook know that I have permission to do this.
Does anyone have a "white hat" solution to "liking" a facebook page within a form besides the obvious facebook like box plugin?
This is not possible.
Yes I could auto like them on submit
How would you do that? I can't think of a way to "Like" a Facebook Page programatically!
To be able to like a page, you'll need to get extended permissions from the user and use the Graph API's Publishing Feature. However, this can't be done using the Registration Social Plugin.
As I said you will need to use the Graph API to authenticate the user, while doing that you will need to request permission to publish_stream which will allow you to like your page after authentication by making a Graph POST request to Like the object.
However, although you can do this, it is far more complex than the Registration Plugin, it requires more steps and much more work on your end. However, if you really want to do it, it is certainly possibly.

How can I check if the fb:like button is already pressed on my own page?

I have a website serving free mp3-downloads and I would like them to be only available for facebook fans of the fb-page of the website. The links are thus hidden unless the user is a fan.
I have reached partial functionality by subscribing to the 'edge.create' event, but this event is not fired when the like box is loaded and the page has already been liked.
I don't really know what the best way to do this is, or whether it's possible at all without user permission. Most information on facebook forums is horribly outdated and a lot of it is related to on-facebook facebook apps/tabs, which is not my case.
To clarify: my facebook like button is on my own domain, in my own code.
This is not possible without user permission. You need to ask the user for the user_likes permission as documented here.

Facebook page apps - Authorizing a user

I can't seem to find exactly what I'm looking for. We're trying to build an app to run solely on a Facebook Page. We want to show a landing page if they don't Like the page, and the contest entry form if they do. This functionality works.
Before showing the contest entry form, we'd like to authenticate the user viewing the app so that they can just hit "Enter the contest!" and we can automatically pull a name/email address.
Any of the methods of authentication I've seen described, including through the Facebook Developer docs, don't work at all.
I saw something that said they need to interact with the app first, then you can get the id, but that doesn't work either. I also don't get the page id passed with the signed request.
Its also pretty unclear whether I should be using an iframe or just FBML.
Could anyone point me in the right direction, please? Thanks!
You need to create a fan page and add the FBML plugin to that page, then you will need to insert a short code that will determine if a facebook user has clicked 'Like' or not and by determining that you will decide weather to display the content of the landing page or not (using an iframe). You will probably like to also set the FBML box that you create as the default view for members who didn't press the 'Like' button yet, you can change the default view in your fan page settings.
On the iframe, you will need to use the Facebook API if you want to retrieve any user information from Facebook, for that, you will need to register a new application with Facebook. Go to developers.facebook.com for the API integration and app registration.
Also, what do you mean when you say:
Any of the methods of authentication
I've seen described, including through
the Facebook Developer docs, don't
work at all.
Well, it appears you can't do it that way. The client was very specific in wanting that functionality but we ended up convincing them to go for a redirect to the canvas page to have the app authorized and the contest entered instead.