[auth][ios] Add auth language methods

This commit is contained in:
Elliot Hesp 2017-11-30 10:17:04 +00:00
parent 8511705d8e
commit b266a04510
1 changed files with 28 additions and 0 deletions

View File

@ -912,6 +912,34 @@ RCT_EXPORT_METHOD(fetchProvidersForEmail:
return credential;
}
/**
setLanguageCode
@param NSString code
@return
*/
RCT_EXPORT_METHOD(setLanguageCode:
(NSString *) appName
code:
(NSString *) code) {
FIRApp *firApp = [FIRApp appNamed:appName];
[FIRAuth authWithApp:firApp].languageCode = code;
}
/**
useDeviceLanguage
@param NSString code
@return
*/
RCT_EXPORT_METHOD(useDeviceLanguage:
(NSString *) appName) {
FIRApp *firApp = [FIRApp appNamed:appName];
[[FIRAuth authWithApp:firApp] useAppLanguage];
}
// This is here to protect against bugs in the iOS SDK which don't
// correctly refresh the user object when performing certain operations
- (void)reloadAndReturnUser:(FIRUser *)user