title: Validating configuration dictionary from MDM server
body: <p>I'm working on an MDM solution using JAMF as my MDM server. I'm using Apple's new API utilizing <code>com.apple.configuration.managed</code> to get the configuration dictionary from the push server. I register to be notified when the dictionary is changed using <code>NSUserDefaultsDidChangeNotification</code> in my <code>NSNotificationCenter.</code> </p>
  
  <p>The problem I'm having is I want to validate the dictionary when I receive it to make sure the tags and everything are correct. When I test this, I'll change something like</p>
  
  <pre><code>&lt;key&gt;Some_Key&lt;/key&gt;
  </code></pre>
  
  <p>to</p>
  
  <pre><code>&lt;key&gt;Some_Key&lt;key&gt;
  </code></pre>
  
  <p>When I submit my broken dictionary, I'm never notified of the change in the dictionary, my console just reads out:</p>
  
  <pre><code>Oct 11 15:26:21-iPad mdmd[2772] &lt;Notice&gt;: (Note ) MDM: Push token received.
  Oct 11 15:26:21-iPad mdmd[2772] &lt;Notice&gt;: (Note ) MDM: Received push notification.
  Oct 11 15:26:21-iPad mdmd[2772] &lt;Notice&gt;: (Warn ) MDM: Ignoring extra keys in push dictionary: {
          time = 1381519580;
      }
  Oct 11 15:26:21-iPad mdmd[2772] &lt;Notice&gt;: (Note ) MDM: Polling MDM server https://jss.jamfcloud.com/mycompany/mdm/ServerURL for next command.
  Oct 11 15:26:21-iPad mdmd[2772] &lt;Notice&gt;: (Note ) MDM: Could not send response to MDM server. Error: NSError:
      Desc   : A connection to the server could not be established.
      US Desc: A connection to the server could not be established.
      Domain : MCHTTPTransactionErrorDomain
      Code   : 23001
      Type   : MCFatalError
      Params : (
          "https://jss.jamfcloud.com/mycompany/mdm/ServerURL",
          400
      )
  </code></pre>
  
  <p>I'm obviously receiving the push, it says so in the second line, but being it's not valid, I guess it's not changing the dictionary stored in <code>com.apple.configuration.managed</code>. How would I intercept an error like this so I can notify the user that the server is configured incorrectly?</p>