Connection to SafariViewService was interrupted

As part of the iOS 9 ATS changes I'm updating an app to use SFSafariViewController for third-party http websites.


When I init and present the instance all I get is a blank white view. No navigation bar, no content..nothing at all. This happens on both device (iOS 9.1) and simulator (iOS 9.1). However on device I get the following debugger message after a minute or so:

Failed to get remote view controller with error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.uikit.viewservice.com.apple.SafariViewService was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid." UserInfo={NSDebugDescription=The connection to service named com.apple.uikit.viewservice.com.apple.SafariViewService was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid.}

The app correctly includes the SafariServices framework. I created a test project to see whether it's possible my SDK installation was at fault but that project works perfectly.


Anyone got any idea what this is or how to resolve it?

Accepted Reply

Apple Developer Technical Support has come back to me with the following:


"There is a bug in the toolbar class used by the Safari View Controller that causes it to continuously perform layout (essentially in an infinite loop) if it or any of its bar buttons have a background image applied via the appearance proxy.


As a workaround, you'll either need to remove the line of code or restrict the appearance customization to instances where the UIBarButtonItem is contained within your own view controller's (you may need to subclass UINavigationController so that you can target your subclass with [UIBarButtonItem appearanceWhenContainedIn:])."

Replies

Apple Developer Technical Support has come back to me with the following:


"There is a bug in the toolbar class used by the Safari View Controller that causes it to continuously perform layout (essentially in an infinite loop) if it or any of its bar buttons have a background image applied via the appearance proxy.


As a workaround, you'll either need to remove the line of code or restrict the appearance customization to instances where the UIBarButtonItem is contained within your own view controller's (you may need to subclass UINavigationController so that you can target your subclass with [UIBarButtonItem appearanceWhenContainedIn:])."

Thank you for following up with the solution / workaround. I'm sure that will help others. 🙂

I'm getting a similar issue as the one above. However, I'm encountering this behavior with Share Extension:

MobileSlideShow[386]: 2016-04-13 15:11:08.629|MobileSlideShow|0x14ce07cd0: HOST: Failed to load remote view controller with error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named <bundle-identifier>.viewservice was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid." UserInfo={NSDebugDescription=The connection to service named <bundle-identifier>.viewservice was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid.}

I am also getting this issue, but it's only happening in the simulator. It happens when I try to present the Google Sign in Controller. I can't see that the Apple Developer Technical Support solution would help-- It's not my view controller being presented.

I'm getting this with a share extension of mine failing too. Did you find a solution?