mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-24 04:24:52 +08:00
more work on multiple app initialization
This commit is contained in:
@@ -1,8 +1,3 @@
|
||||
import { NativeModules } from 'react-native';
|
||||
|
||||
const FirebaseAuth = NativeModules.RNFirebaseAuth;
|
||||
|
||||
|
||||
/**
|
||||
* @url https://firebase.google.com/docs/reference/js/firebase.User
|
||||
*/
|
||||
@@ -106,7 +101,7 @@ export default class User {
|
||||
* @return {Promise}
|
||||
*/
|
||||
delete(): Promise<Object> {
|
||||
return this._auth._interceptUserValue(FirebaseAuth.delete());
|
||||
return this._auth._interceptUserValue(this._auth._native.delete());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,7 +109,7 @@ export default class User {
|
||||
* @param credential
|
||||
*/
|
||||
linkWithCredential(credential: CredentialType) {
|
||||
return this._auth._interceptUserValue(FirebaseAuth.link(credential.provider, credential.token, credential.secret));
|
||||
return this._auth._interceptUserValue(this._auth._native.link(credential.provider, credential.token, credential.secret));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,7 +117,7 @@ export default class User {
|
||||
* @return {Promise} A promise resolved upon completion
|
||||
*/
|
||||
reauthenticateWithCredential(credential: CredentialType) {
|
||||
return this._auth._interceptUserValue(FirebaseAuth.reauthenticate(credential.provider, credential.token, credential.secret));
|
||||
return this._auth._interceptUserValue(this._auth._native.reauthenticate(credential.provider, credential.token, credential.secret));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -130,7 +125,7 @@ export default class User {
|
||||
* @return {Promise}
|
||||
*/
|
||||
reload(): Promise<Object> {
|
||||
return this._auth._interceptUserValue(FirebaseAuth.reload());
|
||||
return this._auth._interceptUserValue(this._auth._native.reload());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -140,7 +135,7 @@ export default class User {
|
||||
*/
|
||||
getToken(forceRefresh: Boolean = false): Promise<Object> {
|
||||
console.warn('Deprecated firebase.User.prototype.getToken in favor of firebase.User.prototype.getIdToken.');
|
||||
return FirebaseAuth.getToken(forceRefresh);
|
||||
return this._auth._native.getToken(forceRefresh);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -148,7 +143,7 @@ export default class User {
|
||||
* @return {Promise}
|
||||
*/
|
||||
getIdToken(forceRefresh: Boolean = false): Promise<Object> {
|
||||
return FirebaseAuth.getToken(forceRefresh);
|
||||
return this._auth._native.getToken(forceRefresh);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -166,7 +161,7 @@ export default class User {
|
||||
* @return {Promise} A promise resolved upon completion
|
||||
*/
|
||||
updateEmail(email: string): Promise<Object> {
|
||||
return this._auth._interceptUserValue(FirebaseAuth.updateEmail(email));
|
||||
return this._auth._interceptUserValue(this._auth._native.updateEmail(email));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -175,7 +170,7 @@ export default class User {
|
||||
* @return {Promise}
|
||||
*/
|
||||
updateProfile(updates: Object = {}): Promise<Object> {
|
||||
return this._auth._interceptUserValue(FirebaseAuth.updateProfile(updates));
|
||||
return this._auth._interceptUserValue(this._auth._native.updateProfile(updates));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -184,13 +179,13 @@ export default class User {
|
||||
* @return {Promise}
|
||||
*/
|
||||
updatePassword(password: string): Promise<Object> {
|
||||
return this._auth._interceptUserValue(FirebaseAuth.updatePassword(password));
|
||||
return this._auth._interceptUserValue(this._auth._native.updatePassword(password));
|
||||
}
|
||||
|
||||
/**
|
||||
* Send verification email to current user.
|
||||
*/
|
||||
sendEmailVerification(): Promise<Object> {
|
||||
return this._auth._interceptUserValue(FirebaseAuth.sendEmailVerification());
|
||||
return this._auth._interceptUserValue(this._auth._native.sendEmailVerification());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user