Open mezalejandro opened 2 years ago
This is how I was get it working:
const getIOSProvider = async (appStoreURL) => {
return await fetch(appStoreURL)
.then((response) => {
const res = response?.json()?.then((info) => {
return info?.resultCount > 0 ? info.results : null
})
return res
});
}
appVersion
as a state:
const App = () => {
const [appVersion, setAppVersion] = useState() // set appVersion from iTunes
const [storeURL, setStoreURL] = useState('')
const appStoreURL = https://itunes.apple.com/${country}/ookup?bundleId=${packageName}
// iTunes API URL of your package
getIOSProvider(appStoreURL).then(res => { // call method if (res[0]) { setAppVersion(res[0].version) // marketing version setStoreURL(res[0].trackViewUrl) // I set this URL to show user the app link } })
if (appVersion) { VersionCheck.needUpdate({ currentVersion: VersionCheck.getCurrentVersion(), // this returns the version setted on the last build latestVersion: appVersion }) .then(res => console.log('VersionCheck', res)); }
I have try on the postman but get this { "resultCount":0, "results": [] }
Hello, on iOS i have this error: No info about this app. When i do this:
VersionCheck.needUpdate().then(async res => { console.log('res ', res); // true });
I have this version: ^3.4.3Thanks