MCPcopy Create free account
hub / github.com/react-native-maps/react-native-maps / withMapsAndroid

Function withMapsAndroid

plugin/src/android.ts:9–32  ·  view source on GitHub ↗
(config, props)

Source from the content-addressed store, hash-verified

7} from '@expo/config-plugins/build/android/Manifest';
8
9const withMapsAndroid: ConfigPlugin<ConfigPluginProps> = (config, props) => {
10 config = withAndroidManifest(config, async conf => {
11 const manifest = conf.modResults;
12
13 const mainApplication = getMainApplicationOrThrow(manifest);
14
15 if (props?.androidGoogleMapsApiKey) {
16 addMetaDataItemToMainApplication(
17 mainApplication,
18 'com.google.android.geo.API_KEY',
19 props?.androidGoogleMapsApiKey,
20 );
21 } else {
22 removeMetaDataItemFromMainApplication(
23 mainApplication,
24 'com.google.android.geo.API_KEY',
25 );
26 }
27
28 return conf;
29 });
30
31 return config;
32};
33
34export default withMapsAndroid;

Callers 1

withMapsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…