Objective-C: How to use xAuth?

I am relatively new to Objective-C and completely new to xAuth. Can anyone show me how or give me a tutorial to get a couple of token access to the request and make a request for the URL, specified username, password, consumer_keyand consumer_secret?

I'm really foggy with this, and I don’t even know why I get a pair of access tokens (why two tokens and how do they both come into the game?). In addition, I have already looked through a bunch of tutorials, but everyone is good for Twitter and uses some kind of Twitter engine. (I use xAuth for Foursquare, and their documentation can be found here .)

Thank!

+3
source share
1 answer

MGTwitterEngine is a great place, for example, for code. You can use the OAuthConsumer project to help make xAuth calls.

If you order MGTwitterEngine.m (shown on Github), you can see in the function

- (NSString *)getXAuthAccessTokenForUsername:(NSString *)username password:(NSString *)password

creates an object OAConsumerwith userKey and Secret, and then creates an object OAMutableURLRequest, you can use Foursquare information there.

Then you can create NSURLConnectionwith this query and then get your results in the standard delegation method, a la URL Loading System

+4
source

Source: https://habr.com/ru/post/1753908/


All Articles