[utils] move play services check

This commit is contained in:
Salakar
2017-10-07 03:09:05 +01:00
parent 0eb38c4593
commit e74b760288
3 changed files with 12 additions and 12 deletions

View File

@@ -19,13 +19,17 @@ export default class RNFirebaseUtils {
*/
checkPlayServicesAvailability() {
if (isIOS) return null;
const code = this.playServicesAvailability.code;
if (!this.playServicesAvailability.isAvailable) {
if (INTERNALS.OPTIONS.promptOnMissingPlayServices && this.playServicesAvailability.isUserResolvableError) {
this.promptForPlayServices();
} else {
const error = INTERNALS.STRINGS.ERROR_PLAY_SERVICES(this.playServicesAvailability.code);
const error = INTERNALS.STRINGS.ERROR_PLAY_SERVICES(code);
if (INTERNALS.OPTIONS.errorOnMissingPlayServices) {
throw new Error(error);
if (code === 2) console.warn(error); // only warn if it exists but may need an update
else throw new Error(error);
} else {
console.warn(error);
}