1 line
2.3 KiB
Plaintext
1 line
2.3 KiB
Plaintext
{"version":3,"file":"GoogleMapsApiKey.js","sourceRoot":"","sources":["../../src/android/GoogleMapsApiKey.ts"],"names":[],"mappings":";;AAEA,gEAAyE;AACzE,yCAOoB;AAEpB,MAAM,YAAY,GAAG,gCAAgC,CAAC;AACtD,MAAM,QAAQ,GAAG,wBAAwB,CAAC;AAE7B,QAAA,oBAAoB,GAAG,6CAA2B,CAC7D,mBAAmB,EACnB,sBAAsB,CACvB,CAAC;AAEF,SAAgB,mBAAmB,CAAC,MAAmC;;IACrE,+BAAO,MAAM,CAAC,OAAO,0CAAE,MAAM,0CAAE,UAAU,0CAAE,MAAM,mCAAI,IAAI,CAAC;AAC5D,CAAC;AAFD,kDAEC;AAED,SAAgB,mBAAmB,CACjC,MAAmC,EACnC,eAAgC;IAEhC,MAAM,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,eAAe,GAAG,oCAAyB,CAAC,eAAe,CAAC,CAAC;IAEnE,IAAI,MAAM,EAAE;QACV,kCAAkC;QAClC,2CAAgC,CAAC,eAAe,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;QACxE,8CAAmC,CAAC,eAAe,EAAE;YACnD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB,CAAC,CAAC;KACJ;SAAM;QACL,2BAA2B;QAC3B,gDAAqC,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;QACrE,mDAAwC,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;KACrE;IAED,OAAO,eAAe,CAAC;AACzB,CAAC;AArBD,kDAqBC","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createAndroidManifestPlugin } from '../plugins/android-plugins';\nimport {\n addMetaDataItemToMainApplication,\n addUsesLibraryItemToMainApplication,\n AndroidManifest,\n getMainApplicationOrThrow,\n removeMetaDataItemFromMainApplication,\n removeUsesLibraryItemFromMainApplication,\n} from './Manifest';\n\nconst META_API_KEY = 'com.google.android.geo.API_KEY';\nconst LIB_HTTP = 'org.apache.http.legacy';\n\nexport const withGoogleMapsApiKey = createAndroidManifestPlugin(\n setGoogleMapsApiKey,\n 'withGoogleMapsApiKey'\n);\n\nexport function getGoogleMapsApiKey(config: Pick<ExpoConfig, 'android'>) {\n return config.android?.config?.googleMaps?.apiKey ?? null;\n}\n\nexport function setGoogleMapsApiKey(\n config: Pick<ExpoConfig, 'android'>,\n androidManifest: AndroidManifest\n) {\n const apiKey = getGoogleMapsApiKey(config);\n const mainApplication = getMainApplicationOrThrow(androidManifest);\n\n if (apiKey) {\n // If the item exists, add it back\n addMetaDataItemToMainApplication(mainApplication, META_API_KEY, apiKey);\n addUsesLibraryItemToMainApplication(mainApplication, {\n name: LIB_HTTP,\n required: false,\n });\n } else {\n // Remove any existing item\n removeMetaDataItemFromMainApplication(mainApplication, META_API_KEY);\n removeUsesLibraryItemFromMainApplication(mainApplication, LIB_HTTP);\n }\n\n return androidManifest;\n}\n"]} |