Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Twitter

Caleb Davenport edited this page Jan 22, 2014 · 11 revisions

The Twitter provider currently comes in two flavors: system and web. Both providers require consumer_key and consumer_secret to be present.

System

The system provider interacts with Accounts.framework and Social.framework to provide authentication. Install the system provider by adding pod 'SimpleAuth/Twitter' to your Podfile. Its provider type is twitter.

If multiple accounts are present, it creates a UIActionSheet and passes it to the block specified by SimpleAuthPresentInterfaceBlockKey. By default, that block shows the action sheet on [[[UIApplication sharedApplication] delegate] window].You can read more about this in Customizing Interface Elements.

Examples

SimpleAuth.configuration[@"twitter"] = @{};
[SimpleAuth authorize:@"twitter" completion:^(id responseObject, NSError *error) {}];

Web

The web provider users a web view to authenticate the user. Install the web provider by adding pod 'SimpleAuth/TwitterWeb to your Podfile. Its provider type is twitter-web.

This provider shows a web view controller by passing it to the block specified by SimpleAuthPresentInterfaceBlockKey. By default, this block wraps the given view controller in a UINavigationController and presents that controller on the topmost presented view controller. Likewise, the controller is dismissed by passing it to the block specified by SimpleAuthDismissInterfaceBlockKey. You can read more about this in Customizing Interface Elements.

Examples

SimpleAuth.configuration[@"twitter-web"] = @{};
[SimpleAuth authorize:@"twitter-web" completion:^(id responseObject, NSError *error) {}];
Clone this wiki locally