Integrating twitter login in IOS - ios

In my IOS app i Want to add twitter login in order to fetch the user's information like Name, Email ID and Profile picture.Can anyone please provide me some useful information or some tutorial link that can help in integrating twitter login in my app and to fetch user information.

If you're just trying to do some really simple login stuff and are new to iOS, I would definitely check out Parse's Twitter Login tools.
https://parse.com/docs/ios_guide#twitterusers/iOS
Really user friendly and simple to get the hang of.

If you want to add twitter login to your app in a simple way, I would recommend you to use Fabric framework. Follow this link: https://dev.twitter.com/fabric/ios
Note: You can't bring user's email easily. You need to get permissions from twitter by filling a form in twitter website or else by sending email to fabric team.

Twitter Kit provides all the required functionalities and mechanism for making authenticated requests to Twitter's REST API.
Follow the configuration process here.
Using TWTRSession, you can request for TWTRUser object and that will have what you need.
This is the right way and advisable one too.

Related

Step-by-step instruction of best practice for using Facebook SignUp and Facebook Login in my iOS application

I know, this might be a very naive question, but I'm having hard time imagining a complete picture of how Facebook SignUp and Facebook Login should be used in my application. I understand Facebook documentation, but it gives me scattered pieces which I can't figure out how to put together. I would appreciate any links for how-tos regarding this issue.
The problem I'm trying to solve, is simply to use Facebook SDK to register users in my application. But, what does this mean? Generally, if we take e-mail registration, this means getting e-mail address and a password, which will be used for later logins. For every login, my server will generate a session id, which will be used in API calls.
Now, I can obtain user's e-mail using Facebook SDK. But now what? What about the password? How should I generate a session id now on my server? Do I have to perform Facebook login call every time I start the app? Or should I send access token to my server and store it in users table and use it for generating session id? I don't need to perform Facebook Graph API calls in my app. All I need - is "single-click" signup/login functionality. What's the right way to do it?

How can My App Tweet the Contents a User Submits?

Note: I am posting this because I don't even know what to Google search. I know we're all about thorough research before asking these questions. Any help would be appreciated.
Scenario: User writes a text post from my app and when they submit it, the content is added to a Parse.com class (I know how to do this) and simultaneously it is tweeted from a designated twitter account (that does not belong to the user) let's say #MyCoolAppThatTweets.
In other words, I don't want the user via my app to be permanently logged into #MyCoolAppThatTweets twitter account, but have one-time access to send a tweet from it.
Another way to phrase this question would be: How can my app log into a specific twitter account whose credentials I can "bake" into the app without compromising the security of that twitter account.
I am already aware that normally, users of an iOS app wouldn't automatically want their content being tweeted. For the project I'm making, this is not going to be a concern (it's a secret).
If you need more information or if I need to post this elsewhere, please let me know!
From your question I am not sure if you are familiar with "Twitter part" of Parse.com and Twitter REST API. If not please start by reading this https://www.parse.com/docs/ios/guide#users-twitter-users (or take a look on official Twitter way by using their plugin called Fabric: https://dev.twitter.com/)
Since you mentioned PFUser I will describe you how to achieve it by using Parse.com API.
First your user must be logged in to Twitter account.
I suppose that your user is already logged in into your app as a PFUser so best way to log him into some Twitter account is by linking Twitter account with existing PFUser - https://www.parse.com/docs/ios/guide#users-linking.
After that you can post tweets through user's Twitter account (if permission was granted). I recommend doing that using Parse.com Twitter API calls https://www.parse.com/docs/ios/guide#users-login-amp-signup. To create API requests you need official Twitter REST API which can be obtained here https://dev.twitter.com/docs/api.

Integration With Facebook

I've never used the FaceBook SDK before so I'm not sure what I should be using or whether what I'm thinking of can actually be done. But I want to try to integrate some Facebook functionality with my ASP.NET MVC3 application.
What I need to do:
I want to be able to access someone's Facebook account (granted their permission) and allow them to send out invitations to my website. But, when a friend clicks on the link in the invitation message (whether a wall post, PM... whatever), follows through and registers on the site, I want to be able to track that (maybe by appending the ID or username of the this user to the invitation link, and then extract it from the query string when the invited person/friend registers).
Questions:
From what I've read so far and according to this link, what I think I should be using is the Facebook Connect API. Am I right?
Is what I'm trying to achieve actually doable? Basically, can I append the username to the invitation link? Is Facebook okey with that?
Do you have any good resources other than the Facebook Developer Wiki? Share them please!
P.S: I do not want users to login to my website using their Facebook account. I have my own Membership system. I just want to allow them to invite their friends to register at my website and track that. More requirements might arise but for now that is all what I need.
Your help is appreciated!
EDIT:
Ok I went ahead and created some test app using the Developer FB app to do some experiments. One thing I do not understand though...
Canvas Page: The base URL of your app on Facebook.
Canvas URL: Facebook pulls the content for your app's canvas pages from this base URL.
So what exactly is the Canvas URL? From what I understand, it's a URL to a resource (page?) on my website which Facebook can display inside the Canvas Page, is that correct?
yes
Yes
Facebook documentation + facebook developers forum, that should be all for you. Also, as you are using asp.net mvc, facebooksdk discussion will help you also if you use that library. I will stringly recommend to use that library.
Also, it seems, you are a beginner on facebook api with c#. If so, you can consider my blog post for beginners on facebook open graph api tutorial in c#. There also some other related posts also.Hope you may like them.
Let me know if you wanted to know something else also specifically.
Yes
Yes
Nope. The Developer Wiki has its issues but the Facebook Docs usually solve your problems.

Simple Facebook API usage in Rails 3

I want to connect my app to Facebook in order to post on the user's wall. I want the user to click to post a message on his Wall, the pop-up of the js SDK should appear, he would login and authorize and get redirected to the home page as the pop-up disappears.
I was trying the fb_graph gem but had some hard troubles and I want to know: Is there a simpler way to do it?
Note that I don't want to make the user able to login in my app with Facebook, just post to his wall.
As Facebook does not offer any Ruby API, you will have to choose between using the JS SDK or implementing a Facebook share link.
If you only want to post in the user's wall, I recommend the second option because of ease and nature. You can customize the content of the post this way.
If you decide to go the JS way, you will have to:
Create a FB app.
Include FB SDK into your page.
Initialize the SDK with your app settings.
Ask for permissions to the user in order to post into her wall.
Assign a button to a function where you check for login. If she's already logged, show a window to post into the wall (FB popup or your own form, as the iframe dialogs are only available inside Facebook pages).
There is another alternative to step 5 by using Graph API and an access token, but it's a little bit more complicated and I don't recommend it if you are new to FB development.
I think, essentially, it's all or nothing when it comes to Facebook authentication. You're asking for permission to take over the user's identity and post on their Facebook wall - there will definitely be some kind of authentication and user approval. It's not a totally trivial process.
I'm sure you've looked already, but if you are OK using any of the social plugins that Facebook offers (http://developers.facebook.com/docs/plugins/), that might be an easier option to achieve what you're looking for.
If not, you'll have to gain a user's permission and post on the wall the way Facebook describes on their site. There's another gem, called Koala (https://github.com/arsduo/koala) that is pretty easy to use as well, but you can also take a look through the fb_graph documentation and see which pieces of code are applicable to your needs and duplicate that functionality.
The best source of information is on Facebook's site (http://developers.facebook.com/docs/reference/api/), where they describe the process in detail:
You can publish to the Facebook graph by issuing HTTP POST requests to the appropriate connection URLs, using an user access token or an app access token (for Open Graph Pages).
and
Most write operations require extended permissions for the active user. See the authentication guide for details on how you can request extended permissions from the user during the authentication step.
The first time I looked at this stuff I was totally overwhelmed, but play around with it and it will make a lot more sense.
I just saw #manuelpedrera 's answer, and that's a good step-by-step guide. Short answer: there's no shortcut.
Koala is a Facebook library for Ruby, supporting the Graph API (including the batch requests and photo uploads), the REST API, realtime updates, test users, and OAuth validation.
Take a look at Koala gem: https://github.com/arsduo/koala

need help with redirection

I want to create an web application that will link up a student's facebook, twitter and orkut accounts all under one shed. Its like connecting all the students within a college, to login into the web app, the userid will be the unique studentID provided by the college
itself.
Now, once a student has logged-in, he can open his facebook, twitter and orkut a/c in the same window, lets say under tabs. How can i do that??
I mean how can i pass a student's Facebook's user-id and password to facebook server and if user authentication is done, then show the student his facebook wall.
I am very confused and don't know how to deal with this.
Storing username and passwords is not a very good idea. Neither Facebook nor twitter supports it through API.
For Facebook integration use the OpenGraph protocol with any SDK that Facebook provides, like Javascript SDK. Mogli is a ruby wrapper for OpenGraph API
For Twitter, there are multiple options like John Nunemaker's Twitter gem. Use that to talk to Twitter API.
Ultimately, it comes down to the architecture of your application. You can start by creating models like 'FacebookConnection' or 'TwitterConnection' and linking them to your 'User' model.
Solving it easy, just make the link open twitter/facebook. if they are signed in there already, their homepage will show, otherwise they will be prompted to enter user/pass.
To integrate your application with those platform, each platform got it's API and connect method, with this you won't need the user password be stored in your app. You instead will, twitter as an example, create a twitter application that communicate with twitter's API, and then redirect the user to twitter asking twitter to grant your application some access to the signed in user account, almost the same as you will sign in with your google account here on stackoverflow.
To do the communication with each of those platform, refer to the API/Connect documentation they provide and implement it in your web application. Don't reinvent the wheel, most of the communication functionality will be already coded in an easy to use library, whether for rubyonrails or most other development frameworks/languages.
look at facebook connect, oath (for twitter) etc instead of storing passwords
divs/iframes with some kind of tab control (jQuery?) to handle toggling of what should be visible.

Resources