我正在开发一个使用 JAMF 作为我的 MDM 服务器的 MDM 解决方案。我正在使用 Apple 的新 API 来com.apple.configuration.managed
从推送服务器获取配置字典。我注册以在使用NSUserDefaultsDidChangeNotification
我的字典更改时收到通知NSNotificationCenter.
我遇到的问题是我想在收到字典时对其进行验证,以确保标签和一切都正确。当我测试这个时,我会改变类似的东西
<key>Some_Key</key>
至
<key>Some_Key<key>
当我提交损坏的字典时,我从未收到有关字典更改的通知,我的控制台只是读出:
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
)
我显然收到了推送,它在第二行中这么说,但是由于它无效,我想它不会更改存储在com.apple.configuration.managed
. 我将如何拦截这样的错误,以便通知用户服务器配置不正确?