mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-24 04:24:52 +08:00
[utils] move play services check
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user