0

I'm trying to integrate "log-in by twitter account" on my app. I've been trying a lot of external SDKs but to no avail. (TwitterAgent / Sharekit) I can't use the official twitter framework cause I'm using IOS 4.3 on xcode 3.2.6. All I want in my app is to be able to log in using his/her twitter account and get the username or user id of the twitter account that is logged in.

Any tutorials that can lead me?

thanks!

Tiago Farias
  • 3,397
  • 1
  • 27
  • 30
Rowie Po
  • 1,339
  • 4
  • 13
  • 17

2 Answers2

0

check this post may help as now almost everyone develops in iOS 5

connecting twitter

n if you hav added the sharekit, import the sharekit file into the view controller where you need twitter & import them

import "SHKTwitter.h"

import "Twitter/Twitter.h"

Community
  • 1
  • 1
darkmystel
  • 198
  • 1
  • 8
  • i already have a twitter api key, what i need is a working sdk for IOS 4.3 if theres any. – Rowie Po Jul 24 '12 at 08:08
  • i got an error Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1 :( – Rowie Po Jul 24 '12 at 08:39
0

As mentioned earlier, Sharekit is the best way to do it on iOS4 and up.

BUT: Have you read the instructions and sticked to them really close?
If not, read this: Sharekit installation and usage

It's dead simple!!!

By the way: Why are you working on Xcode 3? Is it necessary?

EDIT:

please provide a screenshot of your compiler error like this one:
gcc compiler error

Fab1n
  • 2,103
  • 18
  • 32
  • mmm, yea kinda necessary. but anyways, after adding sharekit classes, i get Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1 this error after building. – Rowie Po Jul 24 '12 at 08:53
  • try [this](http://stackoverflow.com/questions/1248520/gcc-4-2-failed-with-exit-code-1-iphone). There can be many reasons for that. Can you copy and paste a few lines more of the error? Therefore you have to go to the build messages or copy from debug console. I'd - by the way - recommend you to update to Xcode 4. You can get it also for Snow Leopard, if you don't have access to the Mac App Store – Fab1n Jul 24 '12 at 09:00
  • thanks! i have already fixed the problem, and now, i just need to integrate twitter log in. i have already read this http://getsharekit.com/install/ but it seems im still lost on where to integrate the twitter log in. :( – Rowie Po Jul 24 '12 at 09:09
  • @RowiePo Just init a simple UIButton, add a target method and add it as subview: `[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(share)]` and than implement the share method like described under **Handling the Button Action** on the website. When your button action is _@selector(share)_ your method has to be named **share** instead of _myButtonHandlerAction_. You can copy the method from the website. Don't forget to import `#import "SHK.h"` at the top of your class. The Action Sheet is produced automatically once clicked on the b – Fab1n Jul 24 '12 at 09:19
  • how do you use the logging in twitter that uses OAuth for authentication and opens up a webview to login? – Rowie Po Jul 24 '12 at 09:31
  • automatically if not already logged in, when you tap on Twitter in the actionsheet – Fab1n Jul 24 '12 at 09:37
  • uhm, i dont want to use the action sheet, is there anyway to call the twitter form from my button? – Rowie Po Jul 24 '12 at 09:38
  • can be possible, but don't know a quick answer at the moment – Fab1n Jul 24 '12 at 11:00