I would really appreciate some help with the Facebook application I currently work on.
I developing a simple Facebook application, and I need to store the data of the people, who click the "I want to win button". I'm not sure if I should use plain, old vanilla PHP, or if the Facebook API provides some simple way to do that, so I would be really glad for some ideas about this.
I read about the topic, but I can't really "see the Matrix" yet, so every answer is appriciated. Also I'm more interested in ideas and not the implementation, as I'm fairly confident in my programming skills.
Thank you everybody!
Richard
You will definitely need to use an external db, coz facebook will not store the data for you. However facebook does store the connection that a user makes with the app, i.e. when a user gives some(even basic) permissions to your app. Hence when an old user comes to your app you can know which, and if it is an old user.
Facebook sends your entry script a signed_request, which contains data about the user visiting your app, this request will have a user_id field only if the user has made the connection/authorized your app, hence you know if it's an old user or new.
Once you have the user_id you can call the graph api to get info about the user. In the php SDK you can easily call $facebookObject->api('/me','GET'); to get user info.
You can easily call the functions anytime, so if you want to make a call when a user clicks your button, you can do that.
Check out the links i have included, thoroughly, you'll get the idea.
Related
I don't use either FaceBook or Twitter, so I am somewhat hampered here.
A friend is going on a once in a life-tine yacht journey and their will be a satellite modem which reports latitude/longitude (and some more data) data on a regular basis. This data gets stored in a database, to which I will have access.
My friend wants to Face/Tweet updates, hopefully with a Google Maps map. He doesn't want to give me his passwords as that would give me full access and let me read his private stuff.
I quite understand that, but what are my options? Obviously, the APIs to FaceTweet won't allow me to post without (his) credentials. Can I create accounts of my own and he can then configure his FaceTweet to say "anything that gets posted there, I want to post it on my site too"? Does Face/Tweet offer such a facility?
The alternative seems to be to code a desktop app to scan the database regularly and post new updates using his password which he must enter into the app, so the app must run on his home PC.
Of course, that is not perfect; if his home PC crashes when he is away then the updates will cease. If it runs on my server, then no problem, but he doesn't want to give me his password and lives too far away to come here and type it in himself.
Can anyone advise me as to how best to implement this? Thanks in advance.
For Facebook you will have to create an application with "Post on your behalf" permission.
Update:
For Twitter it's much trickier: you will have to deal with OAuth tokens to access someone's account after you ask user to authenticate. Here is a fine article on that. You will have to press some free PDF download on our members page and it will ask for you e-mail, but you can press cancel and it redirects you to article anyway.
After a Facebook user authorizes the app, the user has to be verified manually by a live person which needs to see details of his profile, including his pictures etc.
What would be the correct way to implement this?
Should the app download all necessary data from the user's profile after the user authorizes the app? Seems a lot of wasted effort if there is an easier way.
I have already posted this question to http://webapps.stackexchange.com here.
You can't see a whole lot of details on ones profile without that user having authorized your app. You can however see the ProfilPicture, so if that is most important it would be possible.
And since (I presume) a user starts on your own page/site you could add a check in there so that someone can click an 'accept-button' on your side...
But what I really wonder is, why not just make sure the people you don't want to be authorized with you app don't know where to reach the app??
Think that's way easier to sort out a bunch of people...
Preface
I'm aware a similar question has been asked before, but I believe my request is slightly different so I'm going to go for it anyway.
Existing Questions/Findings
I have read the following articles on SO already:
Unfriending someone through the Facebook API?
Any way to unfriend or delete a friend using Facebook's PHP SDK or API?
Previous queries have focussed mainly on silent/programatic un-friending of a user. I don't necessarily need it to be silent and would be quite happy to use a prompted dialogue box.
Is there anything even close to this, or some hack around I could use?
In one of the articles above, an app is mentioned Burger King 'Whopper Sacrifice' which did unfriend I believe. The reason for it being shut down appears to be the privacy invasion/publicising of the un-friending (which seems a bit harsh!) rather than the un-friending itself.
Example idea/Summary
I am looking for some way to simply (either using or not using a prompt) help the user unfriend someone.
As an example, do you think it would be possible to use some kind of call to an iframe to bring up the dialogue?
No, there's no API or Dialog for this functionality. Users can use Facebook's own interface to remove friends but not via 3rd party apps.
Side note, the user can unfriend someone from that person's timeline, if you want one of your users to unfriend someone for some reason, just link them to that timeline and give them the 'unfriend' instructions
There is only way to add user as friend (Friends Dialog) but not terminate friendship, there is no such functionality in API or SDK-s Facebook provide.
I've been trying to get this to work for a while, but I've apparently missed something.
All I want is to have the latest 3 or so posts from my clients Facebook page to populate and animate in a screensaver that I am building using Flash (AS3).
So far, every time I try to bring anything in, it requires a complete oAuth login and account link, but it's only a one way exchange (read-only, absolutely no writing, posting or even linking, since it's a screensaver) I'm not even sure the client wants pictures or anything.
I am currently trying to use the facebook-actionscript-api, but there isn't an option for the "App Login" type of Authentication that would solve most of my problems.
I'm at wits end and about to have to tell my client it can't be done. At least they'll always have twitter...
I don't think it is possible to get facebook feeds without an accesstoken (even if they are public). So I guess you need to define an app within Facebook and add login stuff to your app so users can give permission to your app for basic access.
Maybe this article offers some help: http://www.adobe.com/devnet/facebook/articles/flex_fbgraph_pt1.html
I am new to Facebook API. So, please pardon my ignorance. I have looked around for an answer to my question, but did not find a solution. We are developing an app, which will give a user an option to share with their friends. I want to find out when if a user who comes to the app for the first time, was referred to by a user of the app, or by a link via a marketing campaign or came to know about the app because he/she is a fan of the page. Is that possible? I am more interested in knowing if that user was referred to by a user of the app.
Thanks
Sharma
Add a ?referrer=x tag to your share links where x is the UID of the person sharing the link and use that to determine where the originating traffic is coming. If this is for a tab app you'll need to use app_data to pass the info back to your app and then extract it from the signed request. (more info: https://developers.facebook.com/docs/authentication/signed_request/)