natesymer / fhstwitterengine Goto Github PK
View Code? Open in Web Editor NEWTwitter API for Cocoa developers
License: MIT License
Twitter API for Cocoa developers
License: MIT License
apparently twitter login (using both the iOS account framework and any 3rd-party twitter library) doesn't work on the simulator.
are there any tricks that you use when testing? right now, i'm keeping one of my devices hooked up to xcode, but using the simulator is faster roundtrip.
just curious.
thanks!
/mtr
Send Direct Message in Twitter not working there is error like request sucessfully but not get resonse...
NSJSONSerialization by Apple cannot process nil data, the responseData returned from NSURLConnection can be nil, so that would be a crash. That happened on the two lines.
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
id parsedJSONResponse = removeNull([NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingMutableContainers error:nil]);
So, could you check nil before decoding ? Thanks
Hello, I was trying to search tweets with a particular hashtag
using the method
i had no result
I tried to simplify this method using only the parameter "q" and it works fine! It returns me all recent tweets with the hashtag in the parameter "q"
the simple method is:
(id)searchTweetsWithQuery:(NSString *)q {
if (q.length == 0) {
return [NSError badRequestError];
}
if (q.length > 1000) {
q = [q substringToIndex:1000];
}
NSURL *baseURL = [NSURL URLWithString:url_search_tweets];
NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
[params setObject:q forKey:@"q"];
return [self sendGETRequestForURL:baseURL andParams:params];
}
I hope it helps you.
CP
I got message for Twitter successfully Processed the request,but did not return any content.
I want to use multiple twitter account in my app but whenever i try to again login for new twitter account it take me to again last login twitter account logged before what should i do to get again login screen ...
Hi. Thanks for grate possibility to make work with Twitter so easy. Really us full.
Not sure if this already fixed or not.
in file FHSTwitterEngine.m line 325
I think there instead of
NSURL *baseURL = [NSURL URLWithString:url_friends_list];
should be
NSURL *baseURL = [NSURL URLWithString:url_followers_list];
as method returns list of followers - not friends
Thanks.
I am at +8 timezone, I got wrong date from method "getDateFromTwitterCreatedAt"
I think
@"EEE MMM dd HH:mm:ss +0000 yyyy"
should be
@"EEE MMM dd HH:mm:ss ZZZZ yyyy"
Hi, it doesn't appear as if your library supports app-only auth, but I just wanted to verify? Also, I was interested in using your library and passing either the returned data or the authentication signature to RestKit—do you have any experience with either?
Thanks!
Hi,
I try your demo ,just changed the twitter app id to mine , always get below error info ,but I use API V1 sdk work fine , pls help , thank you .
Error Domain=Twitter is either rate limiting you, or this app just messed up. Code=400 "The operation couldn’t be completed. (Twitter is either rate limiting you, or this app just messed up. error 400.)" UserInfo=0x208d03d0 {request=< OAMutableURLRequest https://api.twitter.com/1.1/statuses/home_timeline.json?since_id=0&count=5 > }
Just a black screen, username is NULL and no errors in logger. No changes made. xAuth still works like a charm )
PS: Is there a method to get users Token and Secret from "engine" without making additional changes to your code ?
PS2: And yeah, thx for what you r doing! You r the best )
Compiler Warning: Variable 'temp' may be uninitialized when used here
If we kill an app , FHSTwiiterEngine are released , so again opening an app , it doesn't save anything, so every time user have to login first , then can post or tweet. This is annoying for user. Also if he tries to post or get results (Follower & Friends list) without logged in again app crashes.
Please provide any solution for this.
Regards.
hey...
m new bee in d dev..bt i need to knw how can we set current latitude and longitude location i.e. lat and long parameter in twitter api query....
also,i wano ask hw can we get location id using FHSTwitterEngine...
meanwhile every simple post i.e. with media and image is getting posted but .png image is not...i have read this issue but still m facing that prblm..dnt knw hw 2 solve...
pls help me..
In the method generateRequestURLSForIDs
This line invokes a crash.
NSString *currentID = [[[idsArray objectAtIndex:lol]stringValue]stringByAppendingString:@","];
I checked that [idsArray objectAtIndex:lol] should be NSString instead of NSNumber.
So I remove stringValue, and then it works.
Whats the license for this? MIT?
Just did a fresh clone of your repo and tried to build the Demo code and I got the following error:
clang: error: no such file or directory: '/Users/mikey/FHSTwitterEngine/FHSTwitterEngine/OAuthConsumer/Crytpo/Base64Transcoder.c'
clang: error: no input files
I can see that this file doesn't exist, and the only reference I can find to this file is in Base64TranscoderFHS.c. I have tried to find out where the wrong file is being included but so far have drawn a blank
I can not authentication after "Remove OAuthConsumer"(Sep 10 2013).
thank you.
Hello Good day,
I got a problem on accessing the block.
Here is the example:
-(IBAction)testLogin{
BOOL test;
[[FHSTwitterEngine sharedEngine]showOAuthLoginControllerFromViewController:self withCompletion:^(BOOL success) {
NSLog(success?@"Succes Login":@"Failed");
if (success) {
test = success;
[self test];
TESTVC *vc = [[TESTVC alloc]initWithNibName:@"TESTVC" bundle:nil];
[self.navigationController pushViewController:vc
animated:YES];
}
}];
NSLOG(@"bool: %d",test);
}
I need this because I'm creating an application that will use the user twitter credential as login to the account your reply is much appreciated thanks.
Hi,
I had integrate this in my local application ,
its working fine with ios6.0 but while i had test in ios 5.1 its give error with copy pin,
please do favor , how to resolve this
xcode 4.5.2 thinks so!
best,
/mtr
ps: thanks for the nice package, i hope to be using it in an application that should be going into alpha soon!
pps: yes, i did add all the -fno-obc-arc entries, otherwise, no compilation joy!
I noticed that the activity indicator was staying on after authentication. I dug around a little and I think that your dismissViewController override is no longer being called due to the blocks update. Modifying it to the new block call seems to address this issue (near line 2050 in FHSTwitterEngine.m).
- (void)dismissViewControllerAnimated:(BOOL)animated completion:(void (^)(void))completion {
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
[[NSNotificationCenter defaultCenter]removeObserver:self];
[self.theWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@""]]];
[super dismissViewControllerAnimated:animated completion:completion];
}
Also, it's a shame that there is no way to pass a completion block. I had to workaround that by handling my code within my viewDidAppear (and a boolean saying we auth'd) to present a popover after dismissing the authentication view.
And I also see the code, there is nothing to deal with the logout or am I missing something?
Cheers
When I post one tweet with image attached, it works fine.
But if I try sending multiple tweets with image (one after another), first one passes through, and for others I receive: "Domain=FHSErrorDomain Code=204 "The request did not return any content."
Strange thing is, if I post multiple tweets with text only, it works just fine. Problem occurs only if images are attached.
first i want to thank you for this great job but i have a problem on iOS 5 on the device when pressed on login via aAuth the FHSTwitterEngineController loading then nothing happend the view dismissed and return me to the main view that i called the FHSTwitterEngineController without login but on simulator it's work
I use the method loginControllerWithCompletionHandler:(void(^)(BOOL success))block;
to create a login UIViewController and handle the completion in call back block.
But there's no call back signal if user taps to "Cancel" instead of "Authorize" in the login view.
Could you please add that callback.
Thanks
Please delete this issue
When try to share with twitter, first time it works but after that
receive error 204.
I have get the following error on authentication.
Error Domain=NSURLErrorDomain Code=-1012 "The operation couldn’t be completed. (NSURLErrorDomain error -1012.)" UserInfo=0x633d0d0 {NSErrorFailingURLKey=https://api.twitter.com/oauth/request_token, NSErrorFailingURLStringKey=https://api.twitter.com/oauth/request_token, NSUnderlyingError=0x629a360 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1012.)"}
POST mutes/users/create
POST mutes/users/destroy
GET mutes/users/ids
GET mutes/users/list
I have a huge problem man,
Alright, so i my iPhone is jailbroken with evasion with IOS 6.1.2
I installed a tweak yesterday and when it respringed it got stuck on apple logo.
Tried everything as going to safe mode and bla bla. Deleting file and so on.
Still stuck.
I can't restore the iPhone via iTunes it gives me errors BUT
I can restorte it with a back up.
BUT HERE IS THE PROBLEM:
It says that it can't back up because my iPhone is having passcode.
I need to remove the passcode somehow!
I actually wrote a mobile substrate add-on for this.
What you need:
Access to a windows computer (for i-funbox)
Both files at Index of /nopasscode
What to do:
Copy them both to /Library/MobileSubstrate/DynamicLibraries/
reboot
Enjoy having no passcode
*This does not reset the passcode, it just tells iOS that the device has no passcode...**
thanks alot!
When I changed consumer key and secret to my own FHSTwitterEngine stopped receiving user access token and secret on authorization.
Strange thing but oAuth works (I mean receiving access token) only on device and doesn't on simulator. xAuth doesn't work anywhere,
Please explain what is so special about consumer key and secret you provided. Can you give that Twitter app setup ?
PS: Seems like my problem is exactly like this #7 with exactly the same error message.
It would be awesome if one could install this Twitter Engine via CocoaPod's pod install
!
destroy URL should be this
NSString *urlString = [NSString stringWithFormat:@"https://api.twitter.com/1.1/statuses/destroy/%@.json", identifier];
The twitter feature in my app is working in the simulator, but when I test it in the device it always crash when trying to fetch new tweets. Any ideas why it's working on simulator but not in the device?
Can't login with xauth
In FHSTwitterEngine you have written
navItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(close)];
There is no close function defined in the class... Clicking cancel causes the app to crash. Please fix
Hi?
Is it possible to have app only authorisation using a consumer key and secret, done in the background then post tweets as the application as opposed to the user?
Regards
Sup Nath !
Thanks to this non-sucky Twitter Engine.
We've integrated twitter with no problems 'till now.
Since you haven't updated for 3months now. There was an update on the twitter APIs a few days ago, including this I will mention.
We cannot use the "postTweet withImage" due to this ...
"Unlike POST statuses/update, this method expects raw multipart data. Your POST request's Content-Type should be set to multipart/form-data with the media[] parameter
The Tweet text will be rewritten to include the media URL(s), which will reduce the number of characters allowed in the Tweet text. If the URL(s) cannot be appended without text truncation, the tweet will be rejected and this method will return an HTTP 403 error."
So if your currently working on it, Great !
If you didn't know this was happening. Well, Tada !
And if you're not planning on working on it, then "aww sucks". Better look for another one. But this was one of the coolest engines made. Kudos to that !
Hello Nath,
I found some issues after the update specially with Login, Logout
Before, when logging out I use [engine clearAccessToken]
and
NSArray *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies];
[cookies enumerateObjectsUsingBlock:^(NSHTTPCookie *cookie, NSUInteger idx, BOOL *stop)
{
[[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:cookie];
}];
and it works fine.. I can still login back but now I can't. On you're logout button you only changed the label and resigned the keyboard.
Is there a way we can login and logout properly? Like the one you had before.
Another is, when I call delegates on the block in showOAuthLogin, with handler, even if used the block method to retain "self" it is still released.
Hi,
Thank you very much for your help and efforts making developers life easy, i'm trying to use your library in my own project to let user connect with twitter using oauth, everything works fine but i'm getting this message (log) i'm using xcode 5 and ios 7 ?
can you please tell me how to fix it, i'm afraid apple may not accept my app on the appstore with such an error (that i don't get but the message is kind of scaring me ^^')
Thank you a lot
MacBook-Pro-de-Soufiane.local FHSTwitterEngine[11756] : CGContextSetFillColorWithColor: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
I've installed the library and have gotten it instantiated properly, but I'm getting three errors in FHSTwitterEngine.h:
FHSTwitterEngine.h:108:41: Cannot find protocol declaration for 'UIWebViewDelegate'; did you mean 'NSTabViewDelegate'?
FHSTwitterEngine.h:318:53: Expected a type
FHSTwitterEngine.h:319:53: Expected a type
Is there anything strange that I should look out for when using this in a 64-bit Cocoa project?
When presenting FHSTwitterEngineController for login purpose on iPad. The navigation bar does not resize width and still keep it in 320 pixels. How's about if we use self.view.bounds.size.width instead?
While running the code I get this error
malloc: *** error for object 0x9fb3680: double free
Found the bug, it so happens that pin and verifier are actually the same object. But in dealloc you are releasing both.
So just comment it out.... So new dealloc function
Hi,
Can you please add a handler for cancel button?
When I'm logined through my personal account, I'm searching form tweets. All tweets in a search results has "favorited" and "retweeted" false event if it's not.
If I'm losing user's timeline that marks are right.
Hope you'll help.
id data = [[DarioTwitterEngine sharedEngine] searchTweetsWithQuery:@" some request" count:10 resultType:FHSTwitterEngineResultTypeMixed unil:nil sinceID:nil maxID:nil];
if ([data isKindOfClass:[NSError class]]) {
DDLogError(@"Twitter error %@", data);
// TODO handle Twitter error
return;
}
NSMutableArray * array = [NSMutableArray array];
for (NSDictionary * status in [data objectForKey:@"statuses"]) {
[array addObject:[SocialPost socialPostFromTwitterData:status]];
}
I'm calling the /lists/members/create_all and I'm getting the error message "The request did not return any content". Why is this happening?
Hi, thanks for your great work.
I have write a demo to use the engine.
But one thing make me confused : I can't post a message with a .png image.
And I tried post .jpg files. It works all right.
The interface I used is :
[[FHSTwitterEngine sharedEngine] postTweet:text withImageData:data];
And the return code is 204 when I tried to post a .png image.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.