find-my-iphone icon indicating copy to clipboard operation
find-my-iphone copied to clipboard

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

Open CodeByAidan opened this issue 2 years ago • 0 comments

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 = "[email protected]";
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... 😭😭

CodeByAidan avatar Feb 11 '23 23:02 CodeByAidan