Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shu223/socialapihelpers
Twitter and Facebook API Helper classes for iOS using Social.framework
https://github.com/shu223/socialapihelpers
Last synced: about 2 months ago
JSON representation
Twitter and Facebook API Helper classes for iOS using Social.framework
- Host: GitHub
- URL: https://github.com/shu223/socialapihelpers
- Owner: shu223
- License: mit
- Created: 2013-08-06T21:41:58.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-01-06T02:56:48.000Z (almost 9 years ago)
- Last Synced: 2024-05-01T20:40:32.048Z (8 months ago)
- Language: Objective-C
- Homepage:
- Size: 168 KB
- Stars: 20
- Watchers: 6
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Social API Helpers
======================**Twitter and Facebook API Helper classes** for iOS using Social.framework. It works on iOS 6 or later.
##How to install
Add to Podfile.
```
pod 'SocialAPIHelpers', :git => 'https://github.com/shu223/SocialAPIHelpers'
```##EXAMPLES: Authorization
###Request access to Twitter
Just call 1 method.
```
[TTMAccountHelper requestAccessToTwitterAccountsWithHandler:^(NSError *error) {
}];
```###Request access to Facebook
Create a dictionary for options (permissions) and call the request method.
```
NSDictionary *options = [TTMAccountHelper optionsToReadStreamOnFacebookWithAppId:kFacebookAppId];[TTMAccountHelper requestAccessToAccountsWithType:ACAccountTypeIdentifierFacebook
options:options
handler:^(NSError *error) {
}];
```###Multi-account support
```
NSArray *accounts = [TTMAccountHelper twitterAccounts];if ([accounts count] >= 2) {
[TTMAccountHelper showAccountSelectWithDelegate:self
inView:self.view];
}
```##EXAMPLES: Access to Twitter API
###Getting user information
####Me
```
[TTMTwitterAPIHelper userInformationForAccount:account
handler:
^(id result, NSError *error) {
NSLog(@"result:%@, error:%@", result, error);
}];
```####Other users
```
[TTMTwitterAPIHelper userInformationWithScreenName:screenName
account:account
handler:
^(id result, NSError *error) {
NSLog(@"result:%@, error:%@", result, error);
}];
```###Read Timeline
####Home
```
[TTMTwitterAPIHelper homeTimelineForAccount:account
handler:
^(id result, NSError *error) {NSLog(@"result:%@, error:%@", result, error);
}];
```####User
```
[TTMTwitterAPIHelper userTimelineWithScreenName:@"shu223"
account:account
handler:
^(id result, NSError *error) {NSLog(@"result:%@, error:%@", result, error);
}];
```##EXAMPLES: Access to Facebook API
###News Feed
```
[TTMFacebookAPIHelper newsfeedForAccount:account
handler:
^(id result, NSError *error) {
NSLog(@"result:%@, error:%@", result, error);
}];
```###Friends
```
[TTMFacebookAPIHelper friendsForAccount:account
handler:
^(NSArray *friends, NSDictionary *result, NSError *error) {NSLog(@"friends:%@, result:%@", friends, result);
}];
```One of returning value `frineds` is an array of "[TTMFacebookProfile](https://github.com/shu223/SocialAPIHelpers/blob/master/SocialAPIHelpers/TTMFacebookProfile.h)" objects.