Getting user id of facebook and twitter in sharekit
Asked Answered
L

5

6

Iam implementing facebook and twitter using sharekit for an iphone app. How can we get the user id of the logged in user so that I could send it to the server. Any help will be greatly appreciated. Thank you.

Louielouis answered 23/1, 2011 at 4:51 Comment(0)
A
1

you can get facebook user information using new facebook graph APIs for sample code you can use this.

Apotheosize answered 26/11, 2011 at 7:20 Comment(0)
I
1

Did you try Step 3 of the installation for Sharekit?

Step 3: Filling in API Keys

Most of the web services that ShareKit integrates require you to use an API key when connecting. An API key is a unique identifer that tells the service what app is making the request.

You have to sign up for each api key, but they are all free and sign-ups are quick.

Locate and open the file SHKConfig.h, just inside the ShareKit group in your project's file list.

At the top you'll find a list of services that require api keys. Each service has a link next to it. Follow the link for each service to get an api key. Fill in the api key for each corresponding service within SHKConfig.h.

Note: Follow the comments within the SHKConfig file, they provide additional steps and possible customizations for each service.

For the full documentation see http://www.getsharekit.com/install/ and http://www.getsharekit.com/docs/

Ingenuous answered 26/1, 2011 at 8:21 Comment(0)
E
1

I don't know about the textual user name, but if you are after the id -

Take a look at ShareKit's SHKFacebook class. It has an FBSession member called session. An FBSession has a FBUID which is just a typedef for long - but I'm assuming it represents some form of user ID.

Emissivity answered 6/2, 2011 at 14:48 Comment(0)
W
1

you can get the ID's by extending the enum in sharetype . add type as ID . and when you can share function introduce the case for ID checking .

- (void)getFollowers
{
    OAMutableURLRequest *oRequest = [[OAMutableURLRequest alloc] initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://api.twitter.com/1/followers/ids.json?cursor=-1&screen_name=%@", SHKTwitterUsername]]
                                                                   consumer:consumer
                                                                      token:accessToken
                                                                      realm:nil   // our service provider doesn't specify a realm
                                                          signatureProvider:nil]; // use the default method, HMAC-SHA1

    [oRequest setHTTPMethod:@"GET"];

    //NSString *message=[NSString stringWithFormat:@"status=oh man! OAuth u almost killed me! more info at http://dev.twitter.com"];
    //[request setHTTPBody:[message dataUsingEncoding: NSUTF8StringEncoding]];

    OADataFetcher *fetcher = [[OADataFetcher alloc] init];
    //todo : handle for error callback
    [fetcher fetchDataWithRequest:oRequest
                         delegate:self
                didFinishSelector:@selector(getListsTokenTicket:didFinishWithData:)
                  didFailSelector:nil];

}
Wayland answered 28/8, 2011 at 14:5 Comment(0)
A
1

you can get facebook user information using new facebook graph APIs for sample code you can use this.

Apotheosize answered 26/11, 2011 at 7:20 Comment(0)
L
0

If you need some user info, user name etc, this problem is solved in reborn ShareKit. See FAQ.

Leta answered 23/11, 2011 at 7:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.