Socket
Socket
Sign inDemoInstall

find-apple-device

Package Overview
Dependencies
77
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    find-apple-device

Unofficial API to use 'Find my Phone' functionality within Node.js. Supports alerts, device & location info, locking phone and remote erase.


Version published
Weekly downloads
2
Maintainers
1
Install size
6.78 MB
Created
Weekly downloads
 

Readme

Source

iCloud Find My iPhone Node Module

What is this for?

Apple provides some really excellent find my phone functions using it's iCloud website. I wanted to use this programmibly so I could track my phone without consuming a lot of additional battery life.

I also wanted a way to send very urgent alerts, for example "Oh no, the house is burning down!" so it will sound an alert even if my phone is on silent.

Before playing with this module, I highly recommend that you activate 2-factor authentication incase you accidentally share your credentials with the world. It won't stop somebody from locking your phone, but it will stop them from doing other nasty stuff or stealing your photos.

There is already another find-my-iphone node module available, but I felt it was a little bit rough for my needs, so I decided to code up this one.

Install

npm install --save find-apple-device

Usage

You can create the instance using the following

var ICloud = require('../index');

var email = "you@example.com";
var password = "PASSWORD_GOES_HERE!";

var iCloud = new ICloud(email, password);

iCloud.getDevices(function(err, devices) {
  if (err) return console.error('Error',err);
  if (devices.length === 0) return console.log("No devices found!");
  console.log(devices);
});

Supported Methods

  • getDevices(callback)
  • silentLostDevice(deviceId, emailUpdates, callback)
  • lostDevice(deviceId, callNumber, text, emailUpdates, callback)
  • alertDevice(deviceId, subject, callback)

Example data

All methods return JSON, please see the examples linked above for more info on how to call each method.

iCloud.getDevices(function(err, devices) {
  if (err) return console.error('Error',err);
  if (devices.length === 0) return console.log("No devices found!");
  console.log(devices[0]);
});

Gives this json object (some data has been faked for privacy)

{
  "id": "0c0fc335a3b69c8fd42fdb3a3+6ee64f9da0c0fc335+a3b69c8fd42fdb3a36ea61475e64f9da",
  "name": "My iPhone",
  "deviceModel": "iphone6splus-abcde-efghi",
  "modelDisplayName": "iPhone",
  "deviceDisplayName": "iPhone 6s Plus",
  "batteryLevel": "0.67",
  "isLocating": true,
  "lostModeCapable": true,
  "location":
   {
     "timeStamp": 1465896490086,
     "isOld": false,
     "isInaccurate": false,
     "locationFinished": false,
     "positionType": "Cell",
     "latitude": "12.123456938235353",
     "horizontalAccuracy": 1414,
     "locationType": null,
     "longitude": "22.125933956343"
   }
}

TODO

  • eraseDevice(deviceId, callback)
  • can we stop these annoying emails?
  • how can we refresh the session easily?
  • how can we check if we are logged in?

Contributing

Feel free to submit any pull requests or add functionality, I'm usually pretty responsive.

If you like the module, please consider donating some bitcoin or litecoin.

Bitcoin

LNzdZksXcCF6qXbuiQpHPQ7LUeHuWa8dDW

LiteCoin

LNzdZksXcCF6qXbuiQpHPQ7LUeHuWa8dDW

Keywords

FAQs

Last updated on 14 Jun 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc