简体   繁体   English

安装.mobileconfig文件后,iPhone不会传递Web应用程序请求的数据

[英]iPhone won't pass web app requested data after installing .mobileconfig file

I'm writing a web app which requests use of the users UDID with a .mobileconfig file which is formatted like so: 我正在编写一个Web应用程序,它请求使用带有.mobileconfig文件的用户UDID,其格式如下:

<!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>
        <dict>
            <key>URL</key>
            <string>https://example.com/profile/enroll</string>
            <key>DeviceAttributes</key>
            <array>
                <string>UDID</string>
                <string>IMEI</string>
                <string>ICCID</string>
                <string>VERSION</string>
                <string>PRODUCT</string>
            </array>
        </dict>
        <key>PayloadOrganization</key>
        <string>www.example.com</string>
        <key>PayloadDisplayName</key>
        <string>Profile Service</string>
        <key>PayloadVersion</key>
        <integer>1</integer>
        <key>PayloadUUID</key>
        <string>3956C530-18F0-4B3D-B4C5-XXXXXXXXXXXX</string>
        <key>PayloadIdentifier</key>
        <string>com.example.profile-service</string>
        <key>PayloadDescription</key>
        <string>This temporary profile will be used to find and display your current device's UDID.</string>
        <key>PayloadType</key>
        <string>Profile Service</string>
    </dict>
</plist>

I have signed this profile with the same certificate I am using for SSL, and it shows up as verified when the user clicks on the profile. 我使用与SSL相同的证书对此配置文件进行了签名,并在用户单击配置文件时显示为已验证。 However, after choosing to install the profile, no data is passed back to my server. 但是,在选择安装配置文件后,没有数据传回我的服务器。 I've tried using 'php://input' and $HTTP_RAW_POST_DATA but both are empty when the page loads. 我尝试过使用'php://input'$HTTP_RAW_POST_DATA但是当页面加载时它们都是空的。 I have determined that the page is actually loading, because I can echo things in the PHP file and they show up. 我已经确定该页面实际上正在加载,因为我可以echo显PHP文件中的内容并显示它们。 Is there something that I am obviously doing wrong? 有什么东西我显然做错了吗?

If I understand the problem correctly, you're wanting pipe the app itself (or something) to the output buffer. 如果我正确理解了这个问题,那么你需要将应用程序本身(或其他东西)传递给输出缓冲区。 For that, you'll want php://output . 为此,你需要php://输出

You can do a one-liner pretty quick with that one using stream_copy_to_stream : stream_copy_to_stream(file://..., php://output); 你可以使用stream_copy_to_stream快速完成一个单行程 :stream_copy_to_stream(file:// ...,php:// output);

If that's not the case, please let me know what I'm missing from your description. 如果情况并非如此,请告诉我您的描述中缺少的内容。

The data is sent with POST. 数据通过POST发送。

print_r($_POST);

and you should see what is being sent 你应该看看发送了什么

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM