Skip to content

Commit

Permalink
Added androidMaxVersion property
Browse files Browse the repository at this point in the history
  • Loading branch information
jbigman committed Aug 3, 2023
1 parent 880a004 commit 9f54194
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Results:
size: 'Varies with device',
androidVersion: 'VARY',
androidVersionText: 'Varies with device',
androidMaxVersion: 'VARY',
developer: 'Google LLC',
developerId: '5700313618786177705',
developerEmail: '[email protected]',
Expand Down
4 changes: 4 additions & 0 deletions lib/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ const MAPPINGS = {
path: ['ds:5', 1, 2, 140, 1, 1, 0, 0, 1],
fun: (version) => version || 'Varies with device'
},
androidMaxVersion: {
path: ['ds:5', 1, 2, 140, 1, 1, 0, 1, 1],
fun: helper.normalizeAndroidVersion
},
developer: ['ds:5', 1, 2, 68, 0],
developerId: {
path: ['ds:5', 1, 2, 68, 1, 4, 2],
Expand Down
9 changes: 9 additions & 0 deletions test/lib.app.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const validateAppDetails = (app) => {
assert.isString(app.contentRating);

assert.equal(app.androidVersion, '7.0');
assert.equal(app.androidMaxVersion, 'VARY');

assert.isBoolean(app.available);
assert.equal(app.priceText, 'Free');
Expand Down Expand Up @@ -196,4 +197,12 @@ describe('App method', () => {
assert.equal(app.available, false);
});
});

it('should fetch android version limit set for some old apps', () => {
return gplay.app({ appId: 'air.com.zinkia.playset' })
.then((app) => {
assert.equal(app.androidVersion, '4.2');
assert.equal(app.androidMaxVersion, '7.1.1');
});
});
});

0 comments on commit 9f54194

Please sign in to comment.