Getting Facebook friends of friends in asp.net web application - javascript

I am creating facebook integrated asp.net web application.I am getting the friends of
logged in user in a grid. I also have the profile pic of the friends. Now i want that
clicking on the pic of a friend should display friends of that friends
(lets say, logged in user is ABC. And he has two friends xyz and def. Now i want that
clicking on the pic of xyz should display the friends of xyz in the same grid.
Can anyone provide me javascript for that or is there any other way?
Any help is appreciated.
Thanks,
Isha.

You cant do this. You can not get a list of friends of a friend of the user that authenticated the application. That's a mouthful! :P let me try simplify -
Lets say you authenticate an application - and allow that application to view your friend list. For the sake of this example let us say that I am in your friend list - and the application has now found me to be a friend of yours. The application can not see MY friend list because I have not authenticated the application. This is an issue of privacy and it is simple not possible with the facebook API (and shouldn't be possible)

There are two problems about that:
1- Facebook see that behaviour like spam and in his politics is prohibited to do that.
2- To see your friendos, the aplication needs permissions like user_friends, and if i am not autenticated with the app, it cant get my access token and cant ask for this permisions, so the app cant look my friends.
Another tip is that there is not a good idea to make a questions saying what you want and asking for the solution like
"Can anyone provide me javascript for that or is there any other way?"
Is better if you expose what you did, the comunity correct your errors and we camo to a solution...

Related

PHP/Javascript Web application invite friends

Application Basics:
Not a game
Native / custom AnjuarlJS UI with PHP server-side code
I am loosing my mind here. I have looked around for over a month for a solution and I am finally posting a question for help.
I have a web application that I am building for a friend. This application is built with a JS(AngularJS) front end and a PHP backend. I have been able to get logic in place for facebook login and allowing users to link a facebook account to their local account in my app. The problem item here now is that we want to be able to allow users with facebook tied to their account to be able to invite their facebook friends to also us our website. With this I want to be able to know the app-scoped ID for the users the invite is sent to to be able to automatically associate the users once the invited friend creates and account via the link.
User A wants to invite User B to the application.
System stored ID of user B
User B clicks on the link and creates an account on the application.
System checks User B's facebook id against list of stored invited ID's
If the system finds the user id the application should be able to now associate them as friends in our native database
Sure I could created a url as such : www.app.com/facebookInvite.php?fromUser=123
but this does not allow the situation where User A AND User C invite User B to the application. Does ANYONE have a solution to this situation? I have yet to find an answer that involves not being a game.
(I hope my question doesn't confuse anyone)
Unfortunately, you cannot know and record B's facebook id without B installing your app. This is changed when they introduced app-scoped ids.
I think the only thing you can do is that store the request with id-name pairs and when B installs the app, check the requests table if B's friends has installed the app and they sent a request to B.
For instance,
Lets say Michael (A here) has id 12, and Dwight has id 11.
inviter_id inviter_name invited_token invited_name
12 Michael as1231e67dqd2e Dwight
When Dwight installed the app, he should have Michael as a friend with id 12. You can then check this table if Dwight is invited by his friends (Michael, Mose etc...) Since the names you stored in invited_name are not unique, this may give wrong results.
I hope I understood your question right :)

HTML / JavaScript - Post message on facebook wall from my web

this question may sound stupid, but im getting frustrated from searching around, and i cant manage to do that:
I want to create a button on my web (not an applications if that matters), and when the user will click on it, it will post a dynamic message on his wall.
Do i have to use javascript SDK for it, or is there a simpler way?
Thanks!
You have to use Facebook Connect (Facebook SDK for Javascript).
Take a look at this:
https://developers.facebook.com/docs/javascript/quickstart/v2.2
But before use this API you need to create an APP ID in the Facebook developers page and use this ID to authenticate through OAuth:
https://developers.facebook.com/apps
This link also explains you how to use Facebook SDK with jQuery
https://developers.facebook.com/docs/javascript/howto/jquery
I hope it helps.
Edited:
If you want something really simple. You can use Social Plugins to allow the user share your website. But I'm not really sure if you want to post a custom message for the user.
https://developers.facebook.com/docs/plugins/share-button/

how to use Facebook share button in my web page to share or post something to facebook page?

i am added a facebook share button to my website it is sharing or posting things to profile timelines but it is not sharing or posting anything to my page(like fans page in facebook).Is there anyway to choose to post to your fan page? any one can help me? plz..
Considering whatever is the "things" in your website, say a product with id 123, for example.
You can make users like it/share it using the standard fb-like button.
When they do like it and/or share it, it comes up as a thing they liked on your website. If that object of yours, has a proper URL with proper meta-tags, it will show up nicely on FB as a story. Good guide here
You can also use the facebook debug tool for testing if the sharing, meta tags are all working as expected here.
If you want your page to be the object of sharing, the only thing that can be done is users can like your page from your website. You cannot share stories from the API to the page, as the page is not an entity. Meaning its not a user.
So, if the page said,
User XYZ liked item ABC on yourwebsite.com
it won't make much sense to the people who see this.
Instead if userXYZ liked an itemABC on your site, the following update on FB will make much more sense.
UserXYZ liked itemABC on yourwebsite.com
(This will have a proper pictorial representation and a clickable link to your website if the like button and the destination url are configured correctly)

Twitter intent and oauth

I was googling and trying a lot with this issue but could not find a solution.
I have a micro site with Javascript. I want to do a "vote" for an awards, and the proceed is "make a tweet->get the user that tweeteed->thanks for voting username!".
I tried with twitter intent, but when I use the Intent Events for "tweet", the param "data" is empty, so I cannot retrieve the username.
Then, I tried creating a twitter ap, with keys and that. I added PHP for that, using different libraries, but the only thing I can achieve is allow to tweet but with the same account of the App, not with any account, as desired.
What I am doing wrong? I got lost.
Thanks a lot!

let only users view and use the site

I have a javascript/php app and i want to do something that let only users view my app. I am thinking of webpage like gate and user should insert username & password then log in and use the app. but i have no idea how to do it. or if there is a better idea.
There's tons of tutorials out there on how to do this, here's one login system with a bit of pizazz.

Categories

Resources