kimxogus / react-native-version-check

A version checker for react-native applications
MIT License
722 stars 179 forks source link

Sometimes needUpdate() returns a null/undefined #115

Open marqroldan opened 4 years ago

marqroldan commented 4 years ago

I did a quick check on the code and it seems like it's correct that it's returning an object which is why I find it weird. It seems to happen whenever there's an interruption with the internet connection or general internet problem. Will dig further

legion-zver commented 4 years ago

@marqroldan hi, you need add country to method options VersionCheck.needUpdate({ country: 'ru', })

I went through the code and found out that the country was based on a current locale (for iOS):

- (NSString*) country
{
    return [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode] ?: @"";
}

And it return empty string for me)

legion-zver commented 4 years ago

@kimxogus hi, please add default country options or change method get country for iOS)))

marqroldan commented 4 years ago

Shouldn't the current locale / country be the one selected as accessing the app stores would be based on where they are? Or is it based on the nationality of the account?

Edit: I haven't had time to thoroughly check on the issue and instead just added a check if the resolved value is an object or not

Hatko commented 4 years ago

We experience the same issue

bahtiyarerden commented 3 years ago

Any update for this Issue?

pietro-marrone-dka commented 1 year ago

up