en IOS 5.0 que estaba abriendo ajuste de Twitter desde mi aplicación porAbrir Twitter Configuración de ACAccountStore (IOS 5.1 TWITTER)
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=TWITTER"]];
pero, esta características se retira en IOS 5.1, por lo tanto no puede capaz de abrir configuración de twitter
Ahora estoy usando
+ (void)makeRequestsWithURL: (NSURL *)url {
// Create an account store object.
ACAccountStore *accountStore = [[ACAccountStore alloc] init];
// Create an account type that ensures Twitter accounts are retrieved.
ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
[self canTweetStatus];
// Request access from the user to use their Twitter accounts.
[accountStore requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error) {
if(granted) {
// Get the list of Twitter accounts.
NSArray *accountsArray = [accountStore accountsWithAccountType:accountType];
// For the sake of brevity, we'll assume there is only one Twitter account present.
// You would ideally ask the user which account they want to tweet from, if there is more than one Twitter account present.
if ([accountsArray count] > 0) {
// Grab the initial Twitter account to tweet from.
ACAccount *twitterAccount = [accountsArray objectAtIndex:0];
// Create a request, which in this example, posts a tweet to the user's timeline.
// This example uses version 1 of the Twitter API.
// This may need to be changed to whichever version is currently appropriate.
TWRequest *postRequest = [[TWRequest alloc] initWithURL:url parameters:nil requestMethod:TWRequestMethodPOST];
// Set the account used to post the tweet.
[postRequest setAccount:twitterAccount];
// Perform the request created above and create a handler block to handle the response.
[postRequest performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
NSString *output = [NSString stringWithFormat:@"HTTP response status: %i", [urlResponse statusCode]];
iOS5Twitter *twitter5 = [[iOS5Twitter alloc] init];
[twitter5 performSelectorOnMainThread:@selector(displayText:) withObject:output waitUntilDone:NO];
[twitter5 release]; }];
}
}
}];
}
para realizar solicitudes, soy capaz de verificar wether estoy Usuario o no por el
if ([TWTweetComposeViewController canSendTweet])
pero ahora Quiero: si no me registran, se mostrará una alerta como se muestra en la imagen y quiero pasar a la configuración de Twitter. Es posible ? o tengo que hacer manualmente la configuración de twitter?
Cómo evitar aparición de teclado en la lógica anterior – ShivaPrasad
@jeeva i piense en el teclado no se muestra o si es simplemente encontrar TextView o campo de texto por (UIView * vista en tweetViewController.view.subviews) {} y hacer que resignFirstResponder . – PJR
Si está buscando algo que funcione en iOS 6.0+ la respuesta [a continuación] (http://stackoverflow.com/questions/11325266/open-twitter-setting-from-acaccountstore-ios-5-1-twitter/13293846 # 13293846) funcionó muy bien. –