Skip to content

please tell me i didn't alert my entire family...Β #28

@CodeByAidan

Description

@CodeByAidan

Um, I may've used this and I logged into my account and ran this example:

var icloud = require("find-my-iphone").findmyphone;

icloud.apple_id = "steve@jobs.com";
icloud.password = "oneMoreThing";

icloud.getDevices(function(error, devices) {
    var device;

    if (error) {
        throw error;
    }
    //pick a device with location and findMyPhone enabled
    devices.forEach(function(d) {
        if (device == undefined && d.location && d.lostModeCapable) {
            device = d;
        }
    });

    if (device) {

        //gets the distance of the device from my location
        var myLatitude = 38.8977;
        var myLongitude = -77.0366;

        icloud.getDistanceOfDevice(device, myLatitude, myLongitude, function(err, result) {
            console.log("Distance: " + result.distance.text);
            console.log("Driving time: " + result.duration.text);
        });

        icloud.alertDevice(device.id, function(err) {
            console.log("Beep Beep!");
        });

        icloud.getLocationOfDevice(device, function(err, location) {
            console.log(location);
        });
    }
});

Please tell me I didn't just alert my entire family... 😭😭

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions