open external weblink from facebook app and pass facebook username - ios

I am building an IOS app that will post weblinks to facebook and other social media using social media framework (not facebook-graph-api) and it works as I desire. eg:
http://example.com/page1.html?code=123456
I do however want that when my friends on facebook open that external link and it opens in an external browser - their facebook user name gets passed on to the browser so I can allow them to add comments to the weblink.
To clarify - the comments to be added will be on my website for the page they just opened (and not the comments in facebook)
Is it possible to do this ?

You can only do something with URL while posting it. Well if we posting URL on wall of known user then we can achieve your problem with following approach.
I think you can append name of friend as a get parameter in URL. So whenever your friend opens this link, its corresponding name is also passed along with URL. As far as security is concerned you can consider to append some security code to URL as well. Which will be validated against Name of friend.
For example.
http://facebook.com/?Name=Friend_Name&SecurityCode=Some_Unique_Code_Based_On_Friends_Name

Related

facebook - getting context of user that clicks on a FB shared link

Is there a way that of a link which an app shared to Facebook via open graph action to the news feed, which when a user/friend of the sharer clicks on it, it redirects to a landing page, where we could grab the information of the user (e.g. Facebook ID) just from the click itself? It might sound a bit magical, but anyone out there knows how?
Of course it´s not possible to just grab the user information just by his click, he MUST authorize your App for that. And you don´t get the real ID anyway, only an "App Scoped ID". Check out the changelog for more information: https://developers.facebook.com/docs/apps/changelog

Does Twitter has a static page for OAuth redirects?

I'm developing a desktop application which is supposed to allow users to login via Twitter.
There seems to be 2 ways to do so, that differ in a way oauth_verifier is returned to the application.
The first one is for web applications and oauth_verifier is returned as a url query parameter when redirecting user back to redirect_url.
The second one is using a PIN displayed to the user, which user enters to the app.
Now Facebook, for example, has a page facebook.com/connect/login_success.html , where FB can redirect a user with ouath_verifier as a query param (e.g. facebook.com/connect/login_success.html?code=<token>. Then I can read that param back from the browser's location field (I'm using an embedded browser).
So, is such a workflow possible with Twitter? Does it have a static page, where it can redirect user with oauth_verifier ?
I haven't been able to find such a page in Twitter's API docs, so I ended up using the main page twitter.com for the redirect. Everything works fine.

How can I open to a specific friend using Find My Friend?

I know the URL Scheme is
findmyfriends://
but how can I open to a specific person if he/she is already a friend? Is there a way to add a friend if he/she is not already a friend?
I prefer using a URL handler but can do JavaScript. I'm trying to embed the code in a web page.
I don't think you can add friends via URL handler.

Inviting *all* your friends to the Facebook Application

At the moment, using the requests dialogue I can get a multi-friend selector come up when I want the user to invite their friends to my application (that's when the "to" parameter isn't defined). On Chrome / Safari - this is a new window, but is there any way of having all of the users friends already selected?
Otherwise - is there a way to put together a request / invite to all of the users friends? I've tried getting an array of all the user's friends id's into the "to" parameter, but that gives an error on FB.
I've seen a few applications on facebook that do make it possible for the user to "select all" or "invite all" of their friends - http://blog.fbsocialapps.com/2011/10/5-ways-to-tune-your-requests-to-improve-the-virality-of-your-facebook-application/
Edit - As mentioned in the comments, I'm doing this on RoR using the omniauth gem + JS SDK. I was hoping that someone may have come across this problem, and can share a solution. My intentions are not to spam, but make it easier for the user to share the application if it's worth sharing.
Basically what the apps mentioned on the site you posted are doing is to use a custom friend selector (See also: Requests Pro-Tips, Pro-Tip 2: Create a Custom Multi-Friend Selector).
This is pretty easy and straight-forward – read the list of the users friends, generate the kind of HTML you’d like them to be displayed with (a Form, an UL, IMG elements with the friends profile picture, Checkboxes to select friends, …). If you don’t want to use the JS SDK, you can do that (reading friends list + generate the HTML) server-side as well in your RoR app.
Only the part where the user can select all friends at once is probably best done client-side – loop through all the HTML elements representing the listed friends, and check the checkboxes via script. Pretty easy if you are for example using jQuery or something.
(Of course this could also be done by just having a checkbox labeled “send request to all friends”, and see if this is checked server-side and then send request to all friends – but that would not provide direct feedback that all friends are selected now to the user on the page.)
Then you could just send the form with all/some friends marked in it to your server-side app, generate the URL for the request dialog there and put the friend’s ids into the toparameter, and redirect the user’s browser to it.

Link on published action with opengraph

I've a trouble with my link on published action.
When my action is published, the link appear like that:
http://www.facebook.com/l.php?u=http%3A%2F%myDomain.com%2F%3Ffb_action_ids%3D3085543269620%26fb_action_types%3Dvideo.watches%26fb_source%3Drecent_activity&h=dAQF21zjX&enc=AZP6SPsPIfAKMoNKqLKjTEig1nsAERVmwUcrfURxEHA34JS11i5ofB29bXKBaOrkm0cOv-Lyg5IVTth3Kr308Qar
And I see on another app who used the same action, the link appear like that:
http://www.facebook.com/connect/uiserver.php?app_id=XXXXXXX&method=permissions.request&redirect_uri=http%3A%2F%2FTheDomain.com%3Ffb_action_ids%3D3056990355815%26fb_action_types%3Dvideo.watches%26fb_source%3Drecent_activity&response_type=token&display=page&auth_referral=1
Did you know why we haven't not the same publish link type ?
I want to publish with an URL like that: http://www.facebook.com/connect/uiserver.php?app_id=XXXXXXX&m.....
Best regards, sorry for my poor english :/
The link of the first type appears when a users click on a link which will take them to an external site.
The link of the 2nd type appears if the app has enabled Authenticated Referrals in the app's settings. When a user click a link of this type, Facebook links into the Authentication Dialog to generate an access token or OAuth code, the user is then redirected to the Action URL.

Resources