mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-29 20:57:00 +08:00
[android][ios][js] Detect missing native module rather than using empty function
This commit is contained in:
@@ -13,7 +13,7 @@ import TwitterAuthProvider from './providers/Twitter';
|
||||
import GithubAuthProvider from './providers/Github';
|
||||
|
||||
const FirebaseAuth = NativeModules.RNFirebaseAuth;
|
||||
const FirebaseAuthEvt = new NativeEventEmitter(FirebaseAuth);
|
||||
const FirebaseAuthEvt = FirebaseAuth && new NativeEventEmitter(FirebaseAuth);
|
||||
|
||||
export default class Auth extends Base {
|
||||
_user: User | null;
|
||||
@@ -22,7 +22,7 @@ export default class Auth extends Base {
|
||||
|
||||
constructor(firebase: Object, options: Object = {}) {
|
||||
super(firebase, options);
|
||||
if (FirebaseAuth.nativeSDKMissing) {
|
||||
if (!FirebaseAuth) {
|
||||
return nativeSDKMissing('auth');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user