-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In IOS getLatestVersion is not working #104
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. So the solution is we provide country as the parameter. |
Thanks @jessejiang0214! But that should be added to the documentation! :D |
yes same here, it worked defining the country manually at least for ios i need to check if for andorid |
@antonioreyna I just had a test on android for this function, it worked quite well (really late response, I know, I only came across this repo yesterday) 😄 |
Hi, I have tried to do the three methods that you comment before and I had the same result: undefined. Searching from google i found this example https://itunes.apple.com/lookup?bundleId=${bundleId}&country=${countryCode} which give me the version and others values like appName, appDescription, minimumOsVersion, currency and +20 more values... My code:
With this 2 methods i know if i have to display the update app flow or not Used libraries versions
Source: https://medium.com/usemobile/get-app-version-from-app-store-and-more-e43c5055156a |
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:
|
Is the issue not with this line? return fetch(
`https://itunes.apple.com/${countryCode}lookup?bundleId=${opt.packageName}&date=${dateNow}`, // this line
opt.fetchOptions
) Unpacking that:
Can become (removing
Look at the I've verified that putting a return fetch(
`https://itunes.apple.com/${countryCode}/lookup?bundleId=${opt.packageName}&date=${dateNow}`,
opt.fetchOptions
) That is what I'd suspect? Can you confirm @kimxogus |
I did this and it works
|
the example to get latestVersion for iOS
|
This will help https://www.youtube.com/watch?v=q3-Mrwd1Vm0 |
I 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
The text was updated successfully, but these errors were encountered: