Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is a method for following a user on twitter</p> <pre><code>-(void)followTwitter{ ACAccountStore *account = [[ACAccountStore alloc] init]; ACAccountType *accountType = [account accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter]; [account requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error) { NSLog(@"this is the request of account "); if (granted==YES) { NSArray *arrayOfAccounts = [account accountsWithAccountType:accountType]; if ([arrayOfAccounts count] &gt; 0) { // Keep it simple, use the first account available ACAccount *acct = [arrayOfAccounts objectAtIndex:0]; NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:@"FollowedUserNameHere",@"screen_name",@"TRUE",@"follow", nil]; TWRequest *request = [[TWRequest alloc] initWithURL:[NSURL URLWithString:@"https://api.twitter.com/1.1/friendships/create.json"] parameters:dictionary requestMethod:TWRequestMethodPOST]; [request setAccount:acct]; [request performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) { if ([urlResponse statusCode] == 200) { // The response from Twitter is in JSON format // Move the response into a dictionary and print NSError *error; NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:responseData options:0 error:&amp;error]; NSLog(@"Twitter response: %@", dict); } else NSLog(@"Twitter error, HTTP response: %i", [urlResponse statusCode]); }]; } } }]; </code></pre> <p>}</p> <p>and follow this link for liking facebook page </p> <p><a href="http://angelolloqui.blogspot.jp/2010/11/facebook-like-button-on-ios.html" rel="nofollow">http://angelolloqui.blogspot.jp/2010/11/facebook-like-button-on-ios.html</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload