Reputation: 7310
I'm working on an MDM solution using JAMF as my MDM server. I'm using Apple's new API utilizing com.apple.configuration.managed
to get the configuration dictionary from the push server. I register to be notified when the dictionary is changed using NSUserDefaultsDidChangeNotification
in my NSNotificationCenter.
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
<key>Some_Key</key>
to
<key>Some_Key<key>
When I submit my broken dictionary, I'm never notified of the change in the dictionary, my console just reads out:
Oct 11 15:26:21-iPad mdmd[2772] <Notice>: (Note ) MDM: Push token received.
Oct 11 15:26:21-iPad mdmd[2772] <Notice>: (Note ) MDM: Received push notification.
Oct 11 15:26:21-iPad mdmd[2772] <Notice>: (Warn ) MDM: Ignoring extra keys in push dictionary: {
time = 1381519580;
}
Oct 11 15:26:21-iPad mdmd[2772] <Notice>: (Note ) MDM: Polling MDM server https://jss.jamfcloud.com/mycompany/mdm/ServerURL for next command.
Oct 11 15:26:21-iPad mdmd[2772] <Notice>: (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
)
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 com.apple.configuration.managed
. How would I intercept an error like this so I can notify the user that the server is configured incorrectly?
Upvotes: 0
Views: 1072
Reputation: 23268
Here is very high level description of how MDM works:
1) You send push notification. This notification is just a "call home" message.
2) MDM client (integrated in iOS) go to your server to receive one or more commands (as example which set app configuration dictionary)
3) MDM client execute these commands
So, you are right, you received a push. However, you application fails at item #2. It doesn't receive command, so it has no idea whether it's a command to set app configuration or wipe device.
So, first you need to get just basic MDM protocol working and only after that play around with other commands. I believe you won't be notified, even when you submit correct dictionary.
Upvotes: 2