-
Notifications
You must be signed in to change notification settings - Fork 2
Examples
arin2115 edited this page Jul 1, 2023
·
2 revisions
var icloud = require("apple-icloudapi");
icloud.icloudSettingsFile = "settings.json";{
"apple_id": "mail@domain.tld",
"password": "password",
"googleApiKey": "google geocoding api key",
"trustToken": "leave empty if you don't have one"
}icloud.getDevices(function(err, devices) {
if (err) return console.error(err);
devices.forEach(function(d) {
console.log(d);
});
});icloud.getLocationOfDevice(device, function(err, location) {
if (err) return console.error(err);
console.log(location);
});icloud.getDistanceOfDevice(device, 51.9189046, 19.1343786, function(err, result) {
if (err) return console.error(err);
console.log(result.distance.text);
console.log(result.duration.text);
});icloud.alertDevice(device.id, function(err) {
if (err) return console.error(err);
});