I do - I’m still unsure on this.
I have this code:
ACAccountStore *accountStore = [[ACAccountStore alloc] init];
ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
[accountStore requestAccessToAccountsWithType:accountType options:nil completion:^(BOOL granted, NSError *error) {
if (granted) {
NSArray *accounts = [accountStore accountsWithAccountType:accountType];
if (accounts.count > 0)
{
NSURL *mentionsURL = [NSURL URLWithString:@"http://api.twitter.com/1.1/statuses/mentions_timeline.json"];
NSMutableDictionary *parameters = [[NSMutableDictionary alloc] init];
[parameters setObject:@"3" forKey:@"count"];
[parameters setObject:@"0" forKey:@"include_entities"];
for (ACAccount *twitterAccount in accounts) {
SLRequest *twitterInfoRequest = [SLRequest requestForServiceType:SLServiceTypeTwitter
requestMethod:SLRequestMethodGET
URL:mentionsURL
parameters:parameters];
[twitterInfoRequest setAccount:twitterAccount];
[twitterInfoRequest performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
//Do things
}];
}
}
}
}];</code>
Does that code mean I’ve done it correctly for authentication, or is there still more to do?