In the past days I've been reading the Facebook documentation. What I can't get to work is how to make a working script so users can invite their Facebook friends, as friends in my system, who are already registered on my site, via my social connection script made with the Facebook SDK. I would love to give you guys some code to work with, but I need to be honest: can't figure out in any way to make this work. My next step was to search on Google and GitHub. I did find something similar, but not that good. So currently my last hope now is some IT-guru on Stackoverflow. Ideas, tips and links would be very helpful.
Edit:
My intention is to use e-mail to make it work.
If you don't understand the question or have some questions - feel free to ask.
Regards.
You should do this based on Facebook user id, not email.
Save the FB user id to your database, and when a new user registers on your site, pull their friend’s ids from Facebook and compare them to the ids in your database.
You can do this via email address.
Users in your website using their email address and Users of facebook also uses their email address.
You can check if someone invite his friends from facebook. than script check email address available or not in your database. you can show available users via his/her email.
You may get the code from here,
http://developers.facebook.com/docs/reference/dialogs/requests/,where you can use the 'to' field for selecting your friends to invite.
Related
I'm building an app and the client wants the following logic:
User logs in to the app.
User selects a Friend.
User selects a gift that the User will send to his Friend.
User writes a message to his Friend.
Friend receives a SECRET notification about the gift.
With "SECRET" I mean that Friend will not be able to see WHO is the User that sent the gift.
So the concrete question is how to send a notification to the FRIEND without a clue about the USER that sent it? I think is not possible but I want to be sure and check with the experts.
And if it's not possible, what do you recommend to accomplish something like this? Should I use the app request dialog and hope that the Friend will see it? Is there any other FB API tool I can use?
I really appreciate your help.
What you're trying to achieve is not possible with FB's API. As explained already by #CBroe.
You can send a request notification if the user uses your app. However, You can do one thing but that won't be completely anonymous.
You can send the friend a notification from the user and make it just an invite to try the application and after the friend uses your app (authenticates), your app can then send a notification and say someone left a SECRET message for them. This could be after few hours or instant, Whatever you/your client prefers. However as i said, this won't be completely anonymous nor it's hard to guess who left the message unless the friend isn't smart enough to know who that could be.
With the beta Notification API something similar would be possible, but only if the receiver has authenticated your app: https://developers.facebook.com/docs/games/notifications/#impl
Well, basically what I need to do is log in (and register) a Twitter user on my website.
I have read a lot of Twitter libraries, forums, even here and couldn't find an answer. (Twitter api is not very friendly).
The problem that i'm having is that I need the e-mail of the user because my website requires it for registering an user, and I think that Twitter OAuth doesn't provide that information of the users.
The question is:
Is there anyway that Twitter (and this Library or maybe another) provide me the email of the user logued in with my app?
To end this, the reason why I'm asking here is because in Twitter libraries forums, or even in Twitter forums no one answer the question I'm asking here.
Twitter does not currently provide user email addresses through their API.
https://dev.twitter.com/docs/faq#6718
The only course of action is to ask for the user's email address separately in your application.
I am developing a facebook application for phototagging. I need to send e-mail notifications to users who has been tagged. For that I need to check the user account settings->notifications->photos->Tags you in a photo(check whether an e-mail should be sent or not). Is there any provision for that?
Thanks in advance.
hello dude why do not use FQL and Query to Photo_tag Table to get the user_id who is being tagged and sent notification to him
I don't understand the question, Facebook already does this.
Account->Account Settings->Notifications
I want to add contact fetch (gmail,AOL,hotmail,yahoo) script in my social networking site using zend-framework.
Any one can tell me how to do this ?
imo, you would have to log in to the account, get the contact book, scrape the info, show the user the contacts and let him confirm the ones he wants to add, you may also have to have a look at the google api to achieve this.
Still, this is just how i would give it a go. :)
Twitter and Facebook invite new users to send an invitation to everyone in their Gmail, Hotmail, or Yahoo Mail accounts.
Is it easy to add this functionality to a website?
Thanks,
John
Last I checked you basically have to pretend to be a web browser then programatically log in to the site, scrape the contacts, then compose/send the message. It isn't difficult, but it is time consuming as each of these services works differently.
I does, however, look like people have written script for some of this though: example.
Yes!
What they generally do is to send in the email a special URL that contain a code, for example:
www.mysite.com?UserCode=ABC
That code (ABC) is associated to the email of the user so the application undestand which user is trying to subscribe. You must keep in a database the pair: email, code.
HTH
All of the above answers are correct, here is a summary and some more explanation:
You first need to get the user's login for each service you want to get contacts from (I personally don't understand why people would do that - I would never give my GMail password to Facebook, let along some little known web site).
Then you can simulate a login to the said website and grab their contact list as an export (all serious email services allow you to export the contact list as CSV or something). You can implement this yourself or use some external library such as contactgrabber mentioned by Haim.
You then go over their list of contacts and for each contact you generate a key (you want to generate a unique key for each email you send so you'd know who responded to you). Generating the keys is easy - take some info like the current user's email plus the target email address, add the current time and pass everything to a hashing function like SHA1 - should do the trick.
Now store in a database table for each contact you got: the inviting user's ID, the email address being invited and the key you generated.
Lastly send a nice email to each contact with a URL to your website's "invitation activation page" with the correct key applied - like so: http://www.somesite.com/invited?key=123456780abcdefgh
when that page is accessed, get the key from the URL and find it in the table - that would give you the email address that activated the invite and the user that invited them. From here you can take it to where ever you want.