var iPhoneFinder = require('iphone-finder') The following Node.js snippet will print the name, type and location of the newest device on your iCloud profile to the console. You can browse the iphone-finder code on GitHub to reassure yourself it isn’t doing anything bad. As usual, you should take precautions to make sure any script is not trying to steal your personal information. You also need to provide iphone-finder with your iCloud username and password. A simple NPM command will sort that out: npm install iphone-finder Getting Your iPhone’s Locationįirst you need to install the iphone-finder library. However, for the purposes I planned on using this API, this was perfect. The features supported by the lightweight iphone-finder package are much more limited than Susomi: you can only retrieve the “device info”, rather than having the option to send messages, lock the device, etc. Fortunately, I discovered iphone-finder and it seemed to work out of the box. iPhone-Finder – Node.jsįurther searches of GitHub revealed a couple of Node.js libraries for interacting with the Find My iPhone API. Similar to my PHP search, a lot of these packages had been written once and never updated when the API changed. Additionally, I wanted to experiment with something a bit more “cutting edge” than PHP so rather than repairing the scripts myself, I started looking for Node.js equivalents. I did find a gist that promised to support the updated API and a few other repositories that supposedly worked, but I had little success. Unfortunately since that time, it seems that the Find My iPhone API has changed and the script has not been updated to keep up with the changes. I initially trialled Susomi, a PHP script that allowed full-access to the Find My iPhone service, including locating devices, sending messages, remote locking and wiping of lost devices. A year ago this script worked great. Use at your own risk! Susomi – PHP Script Additionally, Apple could again change their API at any time and break this implementation. I’m not being malicious and I’m not hammering their web-service, so I think it’s probably okay. Note: I have no idea if the iCloud EULA allows for this kind of thing. After-all, behind most internet-enabled things these days there is a simple JSON API. A quick Google search revealed a few people had the same idea and led me to find a few GitHub repositories for APIs that wrapped around the Find My iPhone web service. I thought there must be a way to tap into the service to use the information for my own purposes. You can track your iCloud enabled devices to determine if you left your iPad at work or your iPhone on the bus you can send messages or play sounds to help locate and recover them and you can remotely lock or wipe them if you are concerned about the device being stolen. There are limitations to this service however: you must use the official Apple app (or iCloud web-page) and you cannot keep a history of previous locations. The Find My iPhone app is a great feature of iCloud.
0 Comments
Leave a Reply. |