NXPCConnection exception during decoding

Sorry if this is not in the correct place, I wasn't sure.


I am working on a web content filtering plugin. Using the guidelines here, I have crafted a Web Content profile payload which I can use to upload to my device and successfully filter web content. However, I have run into the issue during development that if I add a "VendorConfig" to my payload (marked as "optional" in the spec), then the extension completely fails to launch, and in fact my NEFilterProvider extension class is never initialized (via startFilter(completionHandler: @escaping (Error?) -> Void) is never called).


Upon inspecting the console output of the device I see, among other messages, the following:


Dec 21 16:35:35 Kurts-iPad ((EXTENSION NAME))[2085] <Warning>: <NSXPCConnection: 0x124e37070> connection from pid 1734: Warning: Exception caught during decoding of received message, dropping incoming message.
  Exception: Exception while decoding argument 0 (#2 of invocation):
  <NSInvocation: 0x124d40b80>
  return value: {v} void
  target: {@} 0x0
  selector: {:} startFilterWithOptions:completionHandler:
  argument 2: {@} 0x0
  argument 3: {@?} 0x0 (block)

  Exception: value for key 'NS.objects' was of unexpected class 'NSString'. Allowed classes are 'NSDictionary'.



Now, it's worth noting that the NEFilterDataProvider provides a startFilter() method that I override, but there is no startFilterWithOptions method to override, so I'm not sure why it is looking for this.


Can anyone explain what this error message means? What is the relation between this exception and the existance of a <VendorConfig> in my Web Content Payload?

(Just to clarify: I craft my own web content profile XML, but I have also tried creating them with apple configurator. I run into this issue with the configurator-created XML unless I manually remove the <VendorConfig> section, in which case the configurator-created payload works perfectly fine)

Replies

This is a known bug (r. 24753390). I’m not sure what its current status is (Radar is not a happy camper right now )-:

The workaround I came up with was to encode the stuff that I wanted to put in

VendorConfig
into some other property, like
UserName
. For a plug-in based content filter the system does not look at that property, so you can put all your custom config in there.

Hey, I’m not proud (-;

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

This is a known bug (r. 24753390). I’m not sure what its current status is …

This bug was reported as fixed in iOS 10. What OS version are you testing on? If it’s iOS 10 or later, there’s something else going on here.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks for the reply, I was testing on 9.3.2. This explains why the previous developer had shoved all sorts of info into username in the first place, rather than using VendorConfig as the spec recommends 😉

This explains why the previous developer had shoved all sorts of info into username in the first place, rather than using VendorConfig as the spec recommends

*laugh* Sounds like your previous developer may have been the person who opened the DTS tech support incident that caused me to investigate this in the first place (-:

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"