This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
2021-04-02 02:24:13 +03:00

1 line
1.7 KiB
Plaintext

{"version":3,"file":"Branch.js","sourceRoot":"","sources":["../../src/android/Branch.ts"],"names":[],"mappings":";;AAEA,gEAAyE;AACzE,yCAKoB;AAEpB,MAAM,eAAe,GAAG,yBAAyB,CAAC;AAErC,QAAA,UAAU,GAAG,6CAA2B,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;AAErF,SAAgB,eAAe,CAAC,MAAkB;;IAChD,+BAAO,MAAM,CAAC,OAAO,0CAAE,MAAM,0CAAE,MAAM,0CAAE,MAAM,mCAAI,IAAI,CAAC;AACxD,CAAC;AAFD,0CAEC;AAED,SAAgB,eAAe,CAAC,MAAkB,EAAE,eAAgC;IAClF,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAEvC,MAAM,eAAe,GAAG,oCAAyB,CAAC,eAAe,CAAC,CAAC;IAEnE,IAAI,MAAM,EAAE;QACV,kCAAkC;QAClC,2CAAgC,CAAC,eAAe,EAAE,eAAe,EAAE,MAAM,CAAC,CAAC;KAC5E;SAAM;QACL,2BAA2B;QAC3B,gDAAqC,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;KACzE;IACD,OAAO,eAAe,CAAC;AACzB,CAAC;AAbD,0CAaC","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createAndroidManifestPlugin } from '../plugins/android-plugins';\nimport {\n addMetaDataItemToMainApplication,\n AndroidManifest,\n getMainApplicationOrThrow,\n removeMetaDataItemFromMainApplication,\n} from './Manifest';\n\nconst META_BRANCH_KEY = 'io.branch.sdk.BranchKey';\n\nexport const withBranch = createAndroidManifestPlugin(setBranchApiKey, 'withBranch');\n\nexport function getBranchApiKey(config: ExpoConfig) {\n return config.android?.config?.branch?.apiKey ?? null;\n}\n\nexport function setBranchApiKey(config: ExpoConfig, androidManifest: AndroidManifest) {\n const apiKey = getBranchApiKey(config);\n\n const mainApplication = getMainApplicationOrThrow(androidManifest);\n\n if (apiKey) {\n // If the item exists, add it back\n addMetaDataItemToMainApplication(mainApplication, META_BRANCH_KEY, apiKey);\n } else {\n // Remove any existing item\n removeMetaDataItemFromMainApplication(mainApplication, META_BRANCH_KEY);\n }\n return androidManifest;\n}\n"]}