Skip to content

Instantly share code, notes, and snippets.

@tylerhall
Created July 28, 2010 01:08
Show Gist options
  • Save tylerhall/493145 to your computer and use it in GitHub Desktop.
Save tylerhall/493145 to your computer and use it in GitHub Desktop.
Sosumi multiple devices example.
<?PHP
require 'class.sosumi.php';
$ssm = new Sosumi('username', 'password');
// Print a list of all the devices in your MobileMe account
print_r($ssm->devices);
// $device_number is an integer (0 through ...) that corresponds
// to the device you want info about.
$location_info = $ssm->locate($device_number);
// All of Sosumi's functions support a $device_number argument that
// lets you specify which device to target.
@PaulWieland
Copy link

It appears as though with the current version of the library, you must use the device ID provided by print_r($ssm->devices); It took me a while to figure this out since $ssm->locate() does not throw an error if an invalid $device_number is provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment