Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

Using environment variable in react-native swift

$
0
0

I am working on React-Native App and want to configure env variables which I can share with iOS app and Android.

The documentation requires me to add this line in AppDelegate.m

[GMSServices provideAPIKey:@"Azzz8"];`

Here Azzz8 would be my api key. Now I want to pass this to be in an environment file and pass it from there (to ios and android). Any idea how I can do it?

This is how my code for AppDelegate.m kinda looks like

/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */#import "AppDelegate.h"#import <Firebase.h>#import <React/RCTBridge.h>#import <React/RCTBundleURLProvider.h>#import <React/RCTRootView.h>#import <React/RCTLinkingManager.h>#import <UMCore/UMModuleRegistry.h>#import <UMReactNativeAdapter/UMNativeModulesProxy.h>#import <UMReactNativeAdapter/UMModuleRegistryAdapter.h>#import <GoogleMaps/GoogleMaps.h>@implementation AppDelegate- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{  /* Firebasee App Config */  [FIRApp configure];  [GMSServices provideAPIKey:@"1234"];

Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>