Closed boazin closed 9 years ago
I updated the code, still not working.
From what I was able to dig in the code:
successBlock(username, userID);
(ln 247 - in the success block of verifyCredentialsRemotelyWithSuccessBlock
)
Is getting called twice, with nil in username, and userID,
And only afterwards the GET request from twitter returns (ln 246 in STTwitterOAuth.m) and nothing is done with the result
Not sure why :(
I'm confused. The following code works for me with the latest version of STTwitter. Can you double check that you're also using it? (by typing git pull)
NSString *oauthAccessToken = @"";
NSString *oauthAccessTokenSecret = @"";
NSString *key = @"";
NSString *secret = @"";
STTwitterAPI *twitter = [STTwitterAPI twitterAPIWithOAuthConsumerKey:key
consumerSecret:secret
oauthToken:oauthAccessToken
oauthTokenSecret:oauthAccessTokenSecret];
[twitter verifyCredentialsWithSuccessBlock:^(NSString *username) {
NSLog(@"-- username: %@", username);
} errorBlock:^(NSError *error) {
NSLog(@"-- error: %@", error);
}];
If it still doesn't work for you, can you please setup a minimal Xcode project, so that I'll be able to reproduce and fix the bug? Thank you for your help.
sorry for the noob question - how can I git pull if I'm using pod?
Maybe you can git pull say in /tmp, replace your current STTwitter directory with the new one and run your project again.
P.S. you can get a pod from GIT by doing:
pod 'STTwitter', :git => 'https://github.com/nst/STTwitter.git'
Anyway - a small project works, so it is not the code itself... I'll look for differences between the projects.
Do you think it is related to the fact that STTwitter used to be code in my project? (leftover frameworks?)
Well... after commenting out the verifyCredentialsLocallyWithSuccessBlock
to see if it works and figuring out it is still gets executed I just removed all pods and podCache - reinstalled, and now everything works....
I hate Cocoapods!!!!
Well, thanks again! I believe we found a real bug in the process so it wasn't all for nothing...
Glad to read that.
Don't hesitate to report any other issue you may find in the future.
So here goes - I had an old code of STTwitter not via cocoapods. Using pods now. The problem:
verifyCredentialsWithSuccessBlock
not returning - not success block and not errorBlock. It started with the latest version (0.2.1) so I thought it has something to do with the deprecation of the function. Reverted to 0.2.0 (with patching of the extern to get it to link) Still same thing.When a user already logged-in in the past I'm saving it in
UserDefaults
and retrying with it with the following code. Any assistance on investigating will be appreciated