ElyaConrad/iCloud-API

Only 500 contacts

Opened this issue · 2 comments

I can only get first 500 contacts ..

Here is my code

`

// Require the module
const iCloud = require('apple-icloud');

var session = {}; // An empty session. Has to be a session object or file path that points on a JSON file containing your session
var username = "xxx"; // Your apple id
var password = "xxxx"; // Your password

const readline = require('readline').createInterface({
input: process.stdin,
output: process.stdout
})

var myCloud = new iCloud("icloud-session.json", username, password);

myCloud.on("ready", function() {
console.log("Ready Event!");
// Check if the two-factor-authentication is required
if (myCloud.twoFactorAuthenticationIsRequired) {
// Get the security code using node-prompt
readline.question("Enter Code:", (code) => {
myCloud.securityCode = code;
readline.close()
});
}
else {
console.log("You are logged in completely!");
myCloud.Contacts.list(function(err, data) {
if (err) return console.error(err);
// Successfully your contacts :)
// console.log(data);
console.log(data.contacts.length);
});
}
});

`

Hi,

I am getting this error on Contacts.list method, Can you please help me
{ reason: 'Missing X-APPLE-WEBAUTH-TOKEN cookie', error: 1 }

Thanks
Arvind

I would also be interesting in this fix. Getting the same error.