简体   繁体   中英

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:

<!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. 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. I have determined that the page is actually loading, because I can echo things in the PHP file and they show up. 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 .

You can do a one-liner pretty quick with that one using 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.

print_r($_POST);

and you should see what is being sent

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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