Add callback to SFSafariViewControllerDelegate for 4xx/5xx status codes

Originator:futuretap
Number:rdar://33695641 Date Originated:03-Aug.-2017 10:40 AM
Status:Open Resolved:
Product:iOS + SDK Product Version:11.0 beta 4
Classification:Feature (New) Reproducible:Not Applicable
 
Summary:
When SFSafariViewController is opened for a URL that returns a 404 page, the delegate callback indicates a successful load. I reported this as a bug, you consider it behaves as intended (rdar://33400536). This doesn't solve my problem as I want to know about such errors, particularly at first page load. So I suggest adding another delegate callback:

- (void)safariViewController:(SFSafariViewController *)controller didFailWithHTTPResponse:(NSHTTPURLResponse*)response;

This delegate should be called on 4xx or 5xx HTTP responses.

The purpose of this callback: The app might want to open a backup page instead or dismiss the view controller.

Steps to Reproduce:
 

Expected Results:
 

Actual Results:
 

Version:
11.0 beta 4

Notes:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!