In IOS getLatestVersion is not working
See original GitHub issueI tried following for IOS:
===================== First Method =============================
VersionCheck.getLatestVersion({ provider: ‘appStore’ // for Ios }) .then(latestVersion => { console.log(latestVersion); });
===================== Second Method ===========================
VersionCheck.getLatestVersion().then(latestVersion => {
console.log(latestVersion);
});
===================== Third Method ===========================
VersionCheck.getLatestVersion({
forceUpdate: true,
provider: () => fetch(https://itunes.apple.com/${countryCode}lookup?bundleId=${packageName}
)
.then(r => r.json())
.then(({version}) => version)
}).then(latestVersion =>{
console.log(latestVersion);
});
-
Nothing get Response as Latest Verison of IOS App from appstore.
-
@kimxogus suggest any additional parameters or api changes for get latest version info
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9
Top GitHub Comments
Hi @ChandreshRana ,
I fixed this issue yesterday, but it looks like not this component issue, it’s iTunes API’s issue.
If you check the provider, you will find that the countryCode is all uppercase like “AU”, the funny thing is if you put AU into query url like https://itunes.apple.com/AU/ookup?bundleId=${packageName}, it returns the previous version, for example, 1.2.33. But as I release the new version 1.2.34 in the morning that query still returns me 1.2.33 If the query is https://itunes.apple.com/au/ookup?bundleId=${packageName}, lowercase au. That can return 1.2.34
So the solution is we provide country as the parameter. like VersionCheck.getLatestVersion({country:‘au’})
Update: previous method doesn’t work on iOS Release (App Store) but yes on Debug and Release using simulator/physical iPhone… Android is OK
On testing now: