Comments (9)
I cannot reproduce the issue. I just tried with TweetDeck consumer tokens and XAuth and requested the user stream as you did. I immediately get a dictionary with a single 'friends' key. When the user posts something, I immediately receive the tweet. Please ensure to be using the latest version. Also, ensure your consumer tokens are allowed to use the streaming API. If it still doesn't work, please consider making a sample, minimal project that I can run and debug. Thank you.
from sttwitter.
Hmm. I'll check again, but setting it to @yES returns everything just fine, all replies of everybody included. Setting it to nil gets the same results as before. I'll report back when i try again.
from sttwitter.
In order to ease your tests, you may want to run this code:
STTwitterAPI *api = [STTwitterAPI twitterAPIWithOAuthConsumerKey:TWEET_DECK_CK
consumerSecret:TWEET_DECK_CS
username:USERNAME
password:PASSWORD];
[api verifyCredentialsWithSuccessBlock:^(NSString *username) {
[api getUserStreamDelimited:@NO stallWarnings:@YES includeMessagesFromFollowedAccounts:nil includeReplies:nil keywordsToTrack:nil locationBoundingBoxes:nil progressBlock:^(id response) {
NSLog(@"-- response: %@", response);
} stallWarningBlock:^(NSString *code, NSString *message, NSUInteger percentFull) {
NSLog(@"-- code: %@, message: %@", code, message);
} errorBlock:^(NSError *error) {
NSLog(@"-- error 2: %@", [error localizedDescription]);
}];
} errorBlock:^(NSError *error) {
NSLog(@"-- error 1: %@", [error localizedDescription]);
}];
This is what I get here:
2013-11-10 01:55:01.304 STTwitterDemoOSX[27454:303] -- response: {
friends = (
108527800
);
}
2013-11-10 01:55:12.841 STTwitterDemoOSX[27454:303] -- response: {
contributors = "<null>";
coordinates = "<null>";
"created_at" = "Sun Nov 10 00:55:15 +0000 2013";
entities = {
hashtags = (
);
symbols = (
);
urls = (
);
"user_mentions" = (
);
};
"favorite_count" = 0;
favorited = 0;
"filter_level" = medium;
geo = "<null>";
id = 399339434098692096;
"id_str" = 399339434098692096;
"in_reply_to_screen_name" = "<null>";
"in_reply_to_status_id" = "<null>";
"in_reply_to_status_id_str" = "<null>";
"in_reply_to_user_id" = "<null>";
"in_reply_to_user_id_str" = "<null>";
lang = und;
place = "<null>";
"retweet_count" = 0;
retweeted = 0;
source = web;
text = asd;
truncated = 0;
user = {
"contributors_enabled" = 0;
"created_at" = "Sun Mar 24 08:42:41 +0000 2013";
"default_profile" = 1;
"default_profile_image" = 0;
description = "<null>";
"favourites_count" = 1;
"follow_request_sent" = "<null>";
"followers_count" = 1;
following = "<null>";
"friends_count" = 1;
"geo_enabled" = 1;
id = 1294332967;
"id_str" = 1294332967;
"is_translator" = 0;
lang = en;
"listed_count" = 0;
location = "";
name = "nst022 test account";
notifications = "<null>";
"profile_background_color" = C0DEED;
"profile_background_image_url" = "http://abs.twimg.com/images/themes/theme1/bg.png";
"profile_background_image_url_https" = "https://abs.twimg.com/images/themes/theme1/bg.png";
"profile_background_tile" = 0;
"profile_image_url" = "http://pbs.twimg.com/profile_images/378800000192809050/6a5b12e3e227e4ca8afb2de89a416f2e_normal.gif";
"profile_image_url_https" = "https://pbs.twimg.com/profile_images/378800000192809050/6a5b12e3e227e4ca8afb2de89a416f2e_normal.gif";
"profile_link_color" = 0084B4;
"profile_sidebar_border_color" = C0DEED;
"profile_sidebar_fill_color" = DDEEF6;
"profile_text_color" = 333333;
"profile_use_background_image" = 1;
protected = 0;
"screen_name" = nst022;
"statuses_count" = 34;
"time_zone" = Amsterdam;
url = "<null>";
"utc_offset" = 3600;
verified = 0;
};
}
from sttwitter.
I tried the above in the demo project, replacing the keys with mine, and it still errors out. I do have the latest version of STTwitter. I also tried using the demo app's keys, and the same thing still happens.
Here is what's returned:
2013-11-09 20:32:48.299 STTwitterDemoiOS[5056:70b] -- regexError: (null)
2013-11-09 20:32:48.299 STTwitterDemoiOS[5056:70b] -- body: (null)
2013-11-09 20:32:48.299 STTwitterDemoiOS[5056:70b] -- error 2: The request timed out.
Am I missing something regarding how my app is supposed to be set up in Twitter's application settings?
from sttwitter.
The streaming API is not available to all applications, but you said your application was able to use it.
I uploaded a working test project using TweetDeck tokens http://seriot.ch/temp/STTwitterStreaming.zip.
You should get the stream after entering your login and password.
If it still doesn't work, then maybe you IP is temporarily banned for some reason. Try to print the response headers.
Also, maybe you have a special character in your password or something?
We'll find out :-)
from sttwitter.
I changed my password to the simplest password123 i could think of to eliminate special characters, ran the project after inserting my user/pass, and guess what? Same error! However, when i went back to my project and tried again, I managed to get two streamed tweets back, then the same error, running on device, on LTE (unlimited data, and not on my home network). I've made sure i'm not calling the method multiple times or anything like that, so I don't think it's an IP ban thing as wouldn't that also affect the stream where all replies are included? For the record, this is the error in full I get back
2013-11-10 10:08:21.113 Nightingale[780:60b] error: Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0x181c82f0 {NSErrorFailingURLStringKey=https://userstream.twitter.com/1.1/user.json?stall_warnings=1&stringify_friend_ids=1&delimited=0, NSErrorFailingURLKey=https://userstream.twitter.com/1.1/user.json?stall_warnings=1&stringify_friend_ids=1&delimited=0, NSLocalizedDescription=The request timed out., NSUnderlyingError=0x16e815f0 "The request timed out."}
Edit: Could it be an NSURLCache issue? I do have a cache set up in my app, but it should only cache images...
I'm also calling the streaming method in the completion block of the getHomeTimeline method. Would this be an issue?
from sttwitter.
Ok so I think the problem is not related to the includeReplies
parameter but to the timeout parameter in STHTTPRequest which is, by default, set to 30 seconds. In fact, I've never waited for so long while testing the streaming API. I will remove this timeout for streaming requests. Meanwhile, you can set the kSTHTTPRequestDefaultTimeout
value to zero and hopefully you won't get timeouts anymore. Thank you for spotting this issue and helping me to find out the cause.
from sttwitter.
I removed the timeout for all requests ac58d48.
from sttwitter.
Yes it's fixed! Thank you for your support, I would probably not have thought it was a timing problem! 👍
from sttwitter.
Related Issues (20)
- _getUserStreamStallWarning:... cancelling on receiving friends list?
- Attachment_url HOT 2
- postTokenRequest never callsback success or failure HOT 1
- Use of API only available in iOS 8
- Support for new events APIs HOT 1
- Modify character counter to take into account usernames at beginning of tweets HOT 1
- Carthage Support HOT 1
- STTwitter and iOS 11 HOT 2
- Twitter API request with JSON body HOT 2
- STTwitter in macOS 10.13 HOT 3
- Saving account to device settings HOT 1
- Perform video uploads from local NSData
- SLServiceTypeTwitter is deprecated in ios11 objc "SLServiceTypeTwitter' is deprecated: first deprecated in iOS 11.0"
- media_ids parameter is invalid.
- newest XCode throws warnings: This block declaration is not a prototype
- ⚠️ Legacy APIs must be migrated to new ones within 5 months! HOT 2
- Supporting “full_text” of a tweet with “tweet_mode=extended” HOT 1
- Twitter API 2.0
- How do I set up to jump to the Twitter App to sign in?
- Thread 1: "-[STTwitterAppOnly postTokenRequest:authenticateInsteadOfAuthorize:forceLogin:screenName:oauthCallback:errorBlock:]: unrecognized selector sent to instance 0x280371140" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sttwitter.