Getting a device UDID from .mobileconfig

前端 未结 4 863
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 02:17

I\'m trying to write function similar to http://whatismyudid.com/ that, then approved, will return the users UDID and store it to a database for future reference with that u

4条回答
  •  借酒劲吻你
    2020-11-29 02:47

    I found that by using the above that Apache was being talked to by the Ipad/Iphone - The post by Kyle2011 at https://discussions.apple.com/thread/3089948?start=0&tstart=0 filled in the rest of the solution.

    Basically at the bottom of the retrieve.php page you need to redirect the browser to a directory by using a line similar to the following:-

    header("Location: https://www.example.com/enrolment?params={$params}");
    

    Where enrolment is a directory - this then calls the DirectoryIndex (typically index.php) which can then display stuff to your user.

    To populate the $params variable you need the following line at the top of your retrieve.php script

    $data = file_get_contents('php://input');
    

    You can then parse the $data string to get what you need (try file_put_contents("data.txt", $data); or Kyle2011's example)

    I also changed the Payload UDID to something different by using udidgen in a terminal on a Mac rather than just using whatismyudid.com's.

    Update: From iOS 7.1 some of the files (the .plist IIRC) need to be served over https:// - they will fail to install if everything is served over http:// - probably best to serve everything including the .ipa over https:// to ensure future changes on Apple's side don't cause a problem.

提交回复
热议问题