diff --git a/android/src/main/java/io/invertase/firebase/auth/RNFirebaseAuth.java b/android/src/main/java/io/invertase/firebase/auth/RNFirebaseAuth.java index 601f5cb5..36649088 100644 --- a/android/src/main/java/io/invertase/firebase/auth/RNFirebaseAuth.java +++ b/android/src/main/java/io/invertase/firebase/auth/RNFirebaseAuth.java @@ -1129,6 +1129,7 @@ class RNFirebaseAuth extends ReactContextBaseJavaModule { /** * fetchProvidersForEmail * + * @param appName * @param promise */ @ReactMethod @@ -1163,6 +1164,31 @@ class RNFirebaseAuth extends ReactContextBaseJavaModule { }); } + /** + * Set the language code for the auth module + * @param appName + * @param code + */ + @ReactMethod + public void setLanguageCode(String appName, String code) { + FirebaseApp firebaseApp = FirebaseApp.getInstance(appName); + FirebaseAuth firebaseAuth = FirebaseAuth.getInstance(firebaseApp); + + firebaseAuth.setLanguageCode(code); + } + + /** + * Use the device language + * @param appName + */ + @ReactMethod + public void useDeviceLanguage(String appName) { + FirebaseApp firebaseApp = FirebaseApp.getInstance(appName); + FirebaseAuth firebaseAuth = FirebaseAuth.getInstance(firebaseApp); + + firebaseAuth.useAppLanguage(); + } + /* ------------------ * INTERNAL HELPERS * ---------------- */ diff --git a/lib/modules/auth/index.js b/lib/modules/auth/index.js index 67abfe8a..accc5f8e 100644 --- a/lib/modules/auth/index.js +++ b/lib/modules/auth/index.js @@ -322,6 +322,23 @@ export default class Auth extends ModuleBase { return this._native.fetchProvidersForEmail(email); } + /** + * Sets the language for the auth module using the device language + * @returns {*} + */ + useDeviceLanguage() { + return this._native.useDeviceLanguage(); + } + + /** + * Sets the language for the auth module + * @param code + * @returns {*} + */ + set languageCode(code) { + return this._native.setLanguageCode(code); + } + /** * Get the currently signed in user * @return {Promise}