iOS UIWebView crashes when trying to request url
I got following error,
Assertion failed: (stream != NULL), function cb_spdylay_on_stream_close, file /SourceCache/CFNetwork_Sim/CFNetwork-711.1.12/SPDY/SPDYConnection.cpp, line 1775.
when trying to open link using the code,
- (void)viewDidLoad
{
[super viewDidLoad];
[self.webV loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"https://drive.google.com/file/d/0B_FNaB0Xf3wVRVg3UVhaLWpPclU/view"]]];
}
this error wasn't happened before 3 days
I just ran into this issue, too. I know it doesn't help much, but it looks like it's an iOS 8+ bug when accessing certain servers.
I'm also seeing this when accessing resources from Drive, so maybe they changed something recently?
Information is spotty, but this is what I'm basing my conclusion on.
EDIT:
I haven't had a chance to test this yet, but my current theory is that this problem could be fixed by migrating to using a WebKit-based view for iOS 8.x+ views. I'm hoping to get some time to test this theory in the next day or two. I'll post my results here after that.
NEW EDIT:
I just tested opening the same URL with a WKWebView. The good news is that it didn't crash. The bad news is that I get an error:
Error Domain=WebKitErrorDomain Code=300 "WebKit encountered an internal error"
Not terribly helpful, Apple. I'm still researching, but no more luck yet.
There are 2 solutions for this.
Use this sample UserAgent:
Mozilla/5.0 AppleWebKit/600.5.17 Version/8.0.5 Safari/600.5.17
NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:@"Mozilla/5.0 AppleWebKit/600.5.17 Version/8.0.5 Safari/600.5.17", @"UserAgent", nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dictionary];
It's about Spoofing
Some websites will deliver different content to different programs that ask for the same page. In extreme cases, a website may deny access completely to some programs. When this happens, you can try to gain access to the site by “spoofing” as another browser.
Check details at my blog: http://trinnguyen.com/cocoa-spdy-issue-fixed-for-webview/
We are getting a crash on iOS 8.x at:
CFNetwork 0x0000000184574058 cb_spdylay_on_stream_close + 192
It seems that in iOS 9 Beta 5 and iOS 7.1 it is working perfectly fine.
链接地址: http://www.djcxy.com/p/28868.html