IOS UIWebView crashes when trying to request a url

I got the 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 a link using code,

  - (void)viewDidLoad { [super viewDidLoad]; [self.webV loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"https://drive.google.com/file/d/0B_FNaB0Xf3wVRVg3UVhaLWpPclU/view"]]]; } 

this error was not up to 3 days

+7
ios uiwebview
source share
3 answers

I also ran into this problem. I know this doesn’t help much, but it looks like it is an iOS 8+ error when accessing certain servers.

I also see this when accessing resources from Drive, so maybe they have changed something recently?

The information is spotty, but this is what I base on my conclusion .

EDIT:

I have not yet had the opportunity to verify this, but my current theory is that this problem can be fixed by switching to WebKit-based View for iOS 8.x + views. I hope to get some time to test this theory the next day or two. After that I will publish my results.

NEW EDITING:

I just tested opening the same URL using WKWebView. The good news is that it did not crash. The bad news is that I get an error message:

 Error Domain=WebKitErrorDomain Code=300 "WebKit encountered an internal error" 

Not very useful, Apple. I'm still studying, but no longer lucky.

+2
source share

There are 2 solutions for this.

  • Go to WKWebView: for iOS 8 +
  • Add Custom UserAgent

Use this UserAgent example:

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]; 

This is about Spoofing

Some websites will provide different content to different programs that request the same page. In extreme cases, a website may completely deny access to some programs. When this happens, you can try to access the site by "spoofing" as another browser.

Check the information on his blog: http://trinnguyen.com/cocoa-spdy-issue-fixed-for-webview/

+1
source share

We get 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 works fine.

0
source share

All Articles