Question

In my application I am using Twiiter to Tweet.
If In user's iphone twitter account is not set then on the screen one alert pop up to set twitter account and on clicking on setting button it will direct user to setting's screen.

I would like to delete stored twitter account.

from going to setting screen by my application or programmatically.

My code is this

if ([TWTweetComposeViewController canSendTweet])
   {

       NSLog(@"delete the account");


   }
   else{
        TWTweetComposeViewController *viewController = [[TWTweetComposeViewController alloc] init];
        viewController.view.hidden = YES;

        viewController.completionHandler = ^(TWTweetComposeViewControllerResult result) {
            NSLog(@"coming twitt 11111");
            if (result == TWTweetComposeViewControllerResultCancelled) {

                NSLog(@"coming twitt");
                [self dismissModalViewControllerAnimated:NO];
            }
        };
        [self presentModalViewController:viewController animated:NO];

        [viewController.view endEditing:YES];

   }  

any Help Like link, tutorial, sample code or direction will appreciate.

Was it helpful?

Solution

You will not be able to the delete the account programmatically, this would be a huge issue if you could.

Also start with iOS 5.1 you are no longer able to open the setting.app.

The only thing you can do is explain to your user how to delete there account.

OTHER TIPS

There is a method in ACAccountStore for remove accounts

removeAccount:<#(ACAccount *)#> withCompletionHandler:<#^(BOOL success, NSError *error)completionHandler#>

but it gives this error message The application is not permitted to delete Twitter accounts

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top