I'm using STTwitter library. And I'm trying to send a tweet this way:
[twitterObject postStatusUpdate:@"Testing!!"
inReplyToStatusID:nil
latitude:nil
longitude:nil
placeID:nil
displayCoordinates:nil
trimUser:nil
successBlock:^(NSDictionary *status) {
NSLog(@"-- screenName: %@", @"OK sended");
} errorBlock:^(NSError *error) {
NSLog(@"ERRORRR: %@", error);
}];
So, I want to create my "twitterObject" with the tokens that I save before. Because I want that the users just authenticate in the app once. For that I save the tokens, and that is the reason why I instantiate STTwitterAPI.
I do this way:
STTwitterAPI *twitter =
[STTwitterAPI twitterAPIWithOAuthConsumerName:nil
consumerKey:@"xxx"
consumerSecret:@"xxx"
oauthToken:[defaults objectForKey:@"twitterToken"]
oauthTokenSecret:[defaults objectForKey:@"twitterOauthTokenSecret"]
];
twitter.userName = [defaults objectForKey:@"twitterUsername"];
Is that OK??? Because I can't send my tweet.
I have this ERROR: 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'
Pleaseeee, can anyone help me???
You have to verify the credentials before you can actually send a tweet.
Saving the credentials depends on how you want to connect (OAuth, XAuth, iOS Account, ...)