【发布时间】:2013-10-11 19:35:23
【问题描述】:
我正在开发一个使用 JAMF 作为我的 MDM 服务器的 MDM 解决方案。我正在使用 Apple 的新 API,利用 com.apple.configuration.managed 从推送服务器获取配置字典。在我的NSNotificationCenter. 中使用NSUserDefaultsDidChangeNotification 更改字典时,我注册以收到通知
我遇到的问题是我想在收到字典时对其进行验证,以确保标签和一切都正确。当我测试这个时,我会改变类似的东西
<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 中的字典。我如何拦截这样的错误,以便通知用户服务器配置不正确?
【问题讨论】:
-
我创建了一个简单的服务来安装和配置托管应用程序。如果您对此仍有疑问,请查看 - testmdm.cloudapp.net