albeebe / PHP-FindMyiPhone

PHP class to locate, play sounds, and lock iOS devices
Other
79 stars 49 forks source link

Unable to use example code #1

Open bsmith20 opened 9 years ago

bsmith20 commented 9 years ago

I tried using this piece of code to test the php script, replacing the below icloud_username and icloud_password text with my own icloud creds-

<?php include ("class.findmyiphone.php"); $fmi = new FindMyiPhone("icloud_username", "icloud_password"); $fmi->printDevices(); ?>

However I get the following errors-

Undefined variable: request in class.findmyiphone.php on line 250 Undefined index: X-Apple-MMe-Host in class.findmyiphone.php on line 175 Undefined index: X-Apple-MMe-Scope in class.findmyiphone.php on line 176 Undefined variable: request in class.findmyiphone.php on line 250

Any ideas? Thanks!

farvgnugn commented 9 years ago

@albeebe I am having the same issue as @bsmith20. Any suggestions?

nickaein commented 9 years ago

Same issue.

It seems there is a minor bug in setting the $request variable

mohsin commented 8 years ago

+1 Any solution for this?

nelis249 commented 7 years ago

The $request variable isn't defined. I've corrected that simply using $body. The next problem though is the error: Undefined index: X-Apple-MMe-Host in class.findmyiphone.php on line 175 Undefined index: X-Apple-MMe-Scope in class.findmyiphone.php on line 176

Working code for me: https://github.com/Neal/FindMyiPhone