【问题标题】:Distributing a mobileconfig file over the web通过 Web 分发 mobileconfig 文件
【发布时间】:2011-07-04 08:56:14
【问题描述】:

我正在为 iOS 设备动态生成(在 PHP 脚本中)一个 .mobileconfig 文件,然后通过网络提供它。我正在交付具有 application/x-apple-aspen-config 内容类型和内容配置为 attachment;filename=myprofile.mobileconfig 的文件。

我的问题是我不断收到一条错误消息:Safari 由于未知错误而无法安装配置文件。我究竟做错了什么?请参阅下面的 mobileconfig 文件:

    $content =  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict>
    <key>PayloadContent</key>
    <array>
        <dict>
            <key>PayloadContent</key>
            <array>
                <dict>
                    <key>DefaultsData</key>
                    <dict>
                        <key>apns</key>
                        <array>
                            <dict>
                                <key>apn</key>
                                <string>$apnName</string>
                                <key>password</key>
                                <string>$password</string>
                                <key>proxy</key>
                                <string></string>
                                <key>proxyPort</key>
                                <integer></integer>
                                <key>username</key>
                                <string>$userName</string>
                            </dict>
                        </array>
                    </dict>
                    <key>DefaultsDomainName</key>
                    <string>com.apple.managedCarrier</string>
                </dict>
            </array>
            <key>PayloadDescription</key>
            <string><removed before posting here></string>
            <key>PayloadDisplayName</key>
            <string><removed before posting here></string>
            <key>PayloadIdentifier</key>
            <string><removed before posting here></string>
            <key>PayloadOrganization</key>
            <string><removed before posting here></string>
            <key>PayloadType</key>
            <string>com.apple.apn.managed</string>
            <key>PayloadUUID</key>
            <string>8B9A29CC-7C6E-4E32-B4AD-18ED3FDDB64D</string>
            <key>PayloadVersion</key>
            <integer>1</integer>
        </dict>
    </array>
    <key>PayloadDescription</key>
    <string><removed before posting here></string>
    <key>PayloadDisplayName</key>
    <string><removed before posting here></string>
    <key>PayloadIdentifier</key>
    <string><removed before posting here></string>
    <key>PayloadOrganization</key>
    <string><removed before posting here></string>
    <key>PayloadRemovalDisallowed</key>
    <false/>
    <key>PayloadType</key>
    <string>Configuration</string>
    <key>PayloadUUID</key>
    <string>975760AB-9CCE-4496-9D2F-04FD605DDBB9</string>
    <key>PayloadVersion</key>
    <integer>1</integer>
</dict>
</plist>";

我在模拟器和 iPhone 3G 和 iPhone 4 设备中都遇到了这个问题。

【问题讨论】:

  • 嘿@manuel 你能帮我编写你为生成这个mobileconfig而编写的PHP脚本吗?我是一名 iPhone 开发人员,但对脚本语言一无所知,并且坚持以编程方式创建 mobileconfig:stackoverflow.com/questions/16536494/…

标签: iphone ios ios4 mobile-safari


【解决方案1】:

问题是,虽然 proxy 和 proxyPort 是可选的,但如果 proxyPort 被包含并且为空,就像在我的 xml 中那样,那么配置文件将不会安装,并且会抛出那个烦人的错误。解决方法是在不需要时将其删除。

【讨论】:

  • 嗨 Manuel,你能告诉我如何重定向回我们的网站,因为我必须获取设备信息
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-09-26
  • 1970-01-01
  • 2014-05-19
  • 2014-07-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多