[auth][ios] Add app language constants

This commit is contained in:
Elliot Hesp 2017-11-30 12:08:12 +00:00
parent 0083ef7a66
commit c736a6bb51
1 changed files with 19 additions and 0 deletions

View File

@ -1166,6 +1166,25 @@ RCT_EXPORT_METHOD(useDeviceLanguage:
return output;
}
/**
* React native constant exports - exports native firebase apps mainly
* @return NSDictionary
*/
- (NSDictionary *)constantsToExport {
NSMutableDictionary *constants = [NSMutableDictionary new];
NSDictionary *firApps = [FIRApp allApps];
NSMutableDictionary *appLanguage = [NSMutableDictionary new];
for (id key in firApps) {
FIRApp *firApp = firApps[key];
appLanguage[firApp.name] = [FIRAuth authWithApp:firApp].languageCode;
}
constants[@"APP_LANGUAGE"] = appLanguage;
return constants;
}
/**
Converts a FIRUser instance into a dictionary to send via RNBridge