Open doguh opened 3 years ago
@doguh you are my hero
It seems like it's not over yet:
var itc = require('itunesconnectanalytics');
var Itunes = itc.Itunes;
var username = 'myname';
var password = 'mypass';
var appId = '12345'; //My apple id
var instance = new Itunes(username, password, {
errorCallback: function(e) {
console.log('Error logging in: ' + e);
},
successCallback: function(d) {
console.log('Logged in');
}
});
instance.getApps(function(error, data) {
console.log(JSON.stringify(data, null, 2));
});
It returns:
Logged in
null
It seems like it's not over yet:
var itc = require('itunesconnectanalytics'); var Itunes = itc.Itunes; var username = 'myname'; var password = 'mypass'; var appId = '12345'; //My apple id var instance = new Itunes(username, password, { errorCallback: function(e) { console.log('Error logging in: ' + e); }, successCallback: function(d) { console.log('Logged in'); } }); instance.getApps(function(error, data) { console.log(JSON.stringify(data, null, 2)); });
It returns:
Logged in null
It turns out that itunes analytics API URL was changed to https://appstoreconnect.apple.com/analytics/api/v1
Good catch @sann05!
I'll update my pull request
@doguh sorry for the @ but you seem to be the only active contributor at this point. Do you have some info on https://github.com/JanHalozan/iTunesConnectAnalytics/issues/43 ? My best guess is that we are using it wrong but cookies aren't explained anywhere in the readme.
What does your implementation look like, do you override .getCookies
somewhere in your app? Whatever I try, the session only survives for about 6 hours .__.
@Reiszecke I'm not using 2FA so I don't know about this issue.
That being said, the session expiring after 6 hours seems normal to me, it can't last forever.
In my implementation I create a new ict.Itunes(login, password, callback)
at the start of every job (a job being pulling app analytics data for our apps for example).
If your job lasts more than 6 hours, perhaps you'll need to create a new ict.Itunes object every 6 hours.
How did you manage to make an account without 2FA tho? I would love to just do that tbh
@Reiszecke It's an relatively old account. I never activated 2FA on it. I don't think there is a way to disable it once it has been enabled :/
Hey @doguh I found this fork which has it all apparently - https://github.com/JanHalozan/iTunesConnectAnalytics/issues/43#issuecomment-910428325
Just letting you know you may want to fetch/merge some commits into your repo too
Connecting to iTunes Connect now results in a 412 error.
Will reject with
StatusCodeError: 412 - {"authType":"sa"}
error.See the PR below for a possible fix: https://github.com/JanHalozan/iTunesConnectAnalytics/pull/52