0

I cant send status update on twitter.

Here is my code..

- (void) tweet{

_engine = [[SA_OAuthTwitterEngine alloc] initOAuthWithDelegate:self];
_engine.consumerKey = @"someKey";
_engine.consumerSecret = @"someSecret";

UIViewController *controller = [SA_OAuthTwitterController controllerToEnterCredentialsWithTwitterEngine: _engine delegate: self];

if (controller)
    [self presentModalViewController: controller animated: YES];
else {
    tweets = [[NSMutableArray alloc] init];
    [self updateStream:nil];
}

[_engine sendUpdate:@"test"];
[self updateStream:nil];

}

Tom Irving
  • 10,041
  • 6
  • 47
  • 63
sicKo
  • 1,241
  • 1
  • 12
  • 35

1 Answers1

2

Try using in this way:

- (void) tweet{


_engine = [[SA_OAuthTwitterEngine alloc] initOAuthWithDelegate:self];
_engine.consumerKey = @"someKey"; //So please make sure that you had replaced the keys over here.
_engine.consumerSecret = @"someSecret";

UIViewController *controller = [SA_OAuthTwitterController controllerToEnterCredentialsWithTwitterEngine: _engine delegate: self];

if (controller)
    [self presentModalViewController: controller animated: YES];
else {
    tweets = [[NSMutableArray alloc] init];
   [_engine sendUpdate:[NSString stringwithFormat:@"Today Test Date is %@",[NSDate date]]]; // You will be able to post any tweet when you are successfully logged in.So post the message after login rather than 
   [self updateStream:nil];
}
}

I am sure it would work for you....

Ajay Sharma
  • 4,509
  • 3
  • 32
  • 59