I would like to embed the facebook request form on the fan page without asking for permission, is it possible that the friend selector does not popup but instead displayed on the fan page?
The problem I am facing is
As I do not want to bother user for permissions I do not have the Current UserId, which I need for computation of who send how many request
Do not want the app request to popup
Do not want to use the fbml as it will get deprecated by June 2012
Any help how can I do this using PHP?
As you say yourself, you need the current user id. I'm sure you can get this without permissions along with other basic data such as name and gender etc.
try:
https://developers.facebook.com/tools/explorer/?method=GET&path=YOURUSERIDand you'll see.
As for showing the multi-friend selector in the page rather than as a popup, I've not done it myself but usually you can specify the display parameter, e.g. &display=page (rather than display=popup
Also, I think you have to use the JS SDK to do this and not PHP:
http://developers.facebook.com/docs/reference/dialogs/requests/
Also, if you want to send notifications to your user's friends then you will require permissions to do so.
Related
I read the Facebook dev info on how to make a request (located here) but I don't exactly understand what it does. Here's what I'd like to do. I'm using PHP and javascript.
I want a logged in user to send a request to a specific URL (with parameters attached) to multiple Facebook users (users who are already signed up for my site). Also, I need to be able to get the users that they selected and save them in the database, because only those users will have access to the URL that they're being invited to.
Are there any suggestions on how I can accomplish this?
I'm thinking you are talking about the a url request. From my experience this can be done using a simple JQuery request. You can find an example here and you can also read up on java APIs and how to use the methods(Google it). Hope this helps.
The requests dialog is for invitations to Facebook Canvas applications.
You are most likely thinking about the send dialog: https://developers.facebook.com/docs/reference/dialogs/send/
Add a callback function to FB.ui call that saves the id, this will only work if the user ids are hardcoded in. If the user manually adds them, I doubt you can track it.
This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
How to publish to a Facebook User's wall when user uses the App from my website?
I developed a Facebook application using PHP from my website. I would like that every time such user uses the application - a post is posted on his/her wall stating that they are using the application and a link to my website.
Can this be done? If yes, how?
If you have to do this then you should use the Dialog API: https://developers.facebook.com/docs/reference/dialogs/feed/
If you do this automatically, users may report your app which may cause Facebook to take it down. It's much better to use a dialog as you're prompting the user to post a message rather than doing it for them.
You might be looking for Open Graph functionality, that wraps up usage to and allows you to post custom stories like "Anna listend to Spotify." Note, you have to have extra permissions to post without a dialog, called "publish_stream."
As for posting on each usage, get the jQuery's document.ready() method and put your Javascript dialog publish bit in there.
This isn't recommended- it's quite annoying. Usually, you have the user post according to some action, or activity, that they want to share. Not just usage. By the way you asked your question, that's why I mentioned Open Graph. That's more accepted now.
(updated) to do via PHP, get the access token, which means forming the authentication url. Have the user "login", which will send them to Facebook to authenticate. When they revisit yoru site, they'll have a "code" which you exchange for an access token (documented on Facebook site). So, you'd have to keep track that the user is in their initial visit, with some kind of session state variable. When they come back after authentication, store their access token, and check to see if they're still on their first visit, then, display a form for posting to their wall. When they've filled out the form, use form submit to Facebook the publish information for the feed post.
This is also not recommended- even the examples on Facebook's site use a hybrid of PHP and Javascript to create the same functionality.
The best thing to do: use Javascript SDK, and use Open Graph.
For example, I have http://www.example.com/abc.html.
If I like this page, how can I detect me that have already like this page using facebook php api.
Give me help, please
You can collect who likes your page using the newest facebook sdk. What you would do is a sort of work around using their app interface, which is just a LIKE script for your site, and then call https://graph.facebook.com//subscriptions to record the information via mysql or whatever db you are using. I use this method when collecting facebook invites for random contests I hold.
You can use cookies that must be set in the Like button callback or can use Facebook Connect to check whether a user likes your page but this way requires extra permissions and a created facebook app.
Also there is a ready solution for jquery:
http://codecanyon.net/item/like-2-unlock-for-jquery/2822035
How to get like status of google+ button on website or url? I am using PHP.
Unfortunately this isn't quite possible. Neither the REST API nor the PlusOne button itselfs provides a method to check whether a user has +1'd the page or not. Furthermore, if you're using PHP, the user would have to authenticate himself first (using OAuth), so that's probably not what you want, anyway.
What you can do, however, is using Javascript to catch actions of the current visitor. You can specify a callback parameter when creating the +1 button which will be called everytime when the user clicks on the +1 button (source).
While this approach doesn't provide you any information about who the user is (in terms of Google+ user), you could track his actions on your server using a cookie or something else. Or, if that's sufficient, just use the information for the duration of his stay.
if you are trying to get the statistics of your website's +1s, google's webmaster tools will provide the data.
YOu can get this from +1 metric menu in left panel in webmaster tools
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