diff --git a/ios/RNFirebase/auth/RNFirebaseAuth.m b/ios/RNFirebase/auth/RNFirebaseAuth.m index 7668fd0f..de68bed2 100644 --- a/ios/RNFirebase/auth/RNFirebaseAuth.m +++ b/ios/RNFirebase/auth/RNFirebaseAuth.m @@ -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