문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top