0

I want to log in my app using Twitter logIn Button, for that i'm using fabric SDK, when i select Xcode IDE in Fabric Page, I am getting error -

I have already given Organization name in setting Page.

enter image description here

Could any one tell me how could i use twitter native Log In button in my App ?

ChenSmile
  • 3,401
  • 4
  • 39
  • 69

1 Answers1

3

I recently installed Fabric SDK. Did you provide your organization's email ID during the registration? If you did, you shouldn't be facing any issues. One suggestion I can provide is to try inviting a colleague of yours and see if it works.

Adding a login button in your app is very simple. In AppDelegate.m, import the header files

#import <Fabric/Fabric.h>
#import <TwitterKit/TwitterKit.h>

Then in your didFinishLaunchingWithOptions method

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [Fabric with:@[TwitterKit]];
    return YES;

}

Open your Main.Storyboard file. Add a UIButton. Select it and open the Identity Inspector (alt+cmd+3). In the Class textfield, enter "TWTRLogInButton". Open your <Whatever>ViewController.m and create a property

@property (nonatomic,strong) IBOutlet TWTRLogInButton *twLoginView;

In the viewDidLoad method, add the following line.

_twLoginView = [TWTRLogInButton buttonWithLogInCompletion:^(TWTRSession *session, NSError *error) {
    // do whatever you wish to do with Twitter session instance.
}];
thandasoru
  • 1,558
  • 2
  • 15
  • 41
  • thanks for ur response. i will check it. is it possible to fetch user email address in twiter using fabric. Thanks – ChenSmile Jan 21 '15 at 07:07
  • @Imran yes you can use `TWTRShareEmailViewController` to requester user email. – CoolMonster Jan 23 '15 at 17:28
  • @thandasoru ... thanks bro. does it possible to get friends details like name, id etc using fabric. please update me – ChenSmile Jan 24 '15 at 12:44
  • @thandasoru i could not see where it s asking email and how can i share with freinds.. plz suggest me link – ChenSmile Jan 24 '15 at 12:58
  • 1
    @Imran I haven't had the time to completely check out the Fabric SDK as I was completely busy with office work. There should be enough documentation in the twitter developer website. – thandasoru Jan 26 '15 at 03:21