-
Notifications
You must be signed in to change notification settings - Fork 137
The Twitter provider currently comes in two flavors: system and web. Both providers require consumer_key
and consumer_secret
to be present.
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.
SimpleAuth.configuration[@"twitter"] = @{};
[SimpleAuth authorize:@"twitter" completion:^(id responseObject, NSError *error) {}];
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.
SimpleAuth.configuration[@"twitter-web"] = @{};
[SimpleAuth authorize:@"twitter-web" completion:^(id responseObject, NSError *error) {}];