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O,CAAC,QAAQ,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;AAC1D,CAAC;AAhBD,sDAgBC","sourcesContent":["import path from 'path';\nimport fs from 'fs-extra';\n\nimport { ExpoConfig } from '../Config.types';\nimport { InfoPlist } from './IosConfig.types';\nimport { appendScheme } from './Scheme';\nimport { addFileToGroup, getPbxproj, getProjectName, getSourceRoot } from './utils/Xcodeproj';\n\nexport function getGoogleMapsApiKey(config: ExpoConfig) {\n return config.ios?.config?.googleMapsApiKey ?? null;\n}\n\n// NOTE(brentvatne): if the developer has installed the google ads sdk and does\n// not provide an app id their app will crash. Standalone apps get around this by\n// providing some default value, we will instead here assume that the user can\n// do the right thing if they have installed the package. This is a slight discrepancy\n// that arises in ejecting because it's possible for the package to be installed and\n// not crashing in the managed workflow, then you eject and the app crashes because\n// you don't have an id to fall back to.\nexport function getGoogleMobileAdsAppId(config: ExpoConfig) {\n return config.ios?.config?.googleMobileAdsAppId ?? null;\n}\n\nexport function getGoogleSignInReservedClientId(config: ExpoConfig) {\n return config.ios?.config?.googleSignIn?.reservedClientId ?? null;\n}\n\nexport function getGoogleServicesFile(config: ExpoConfig) {\n return config.ios?.googleServicesFile ?? null;\n}\n\nexport function setGoogleMapsApiKey(config: ExpoConfig, infoPlist: InfoPlist) {\n let apiKey = getGoogleMapsApiKey(config);\n\n if (apiKey === null) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n GMSApiKey: apiKey,\n };\n}\n\nexport function setGoogleMobileAdsAppId(config: ExpoConfig, infoPlist: InfoPlist) {\n let appId = getGoogleMobileAdsAppId(config);\n\n if (appId === null) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n GADApplicationIdentifier: appId,\n };\n}\n\nexport function setGoogleSignInReservedClientId(config: ExpoConfig, infoPlist: InfoPlist) {\n let reservedClientId = getGoogleSignInReservedClientId(config);\n\n if (reservedClientId === null) {\n return infoPlist;\n }\n\n return appendScheme(reservedClientId, infoPlist);\n}\n\nexport function setGoogleConfig(config: ExpoConfig, infoPlist: InfoPlist) {\n infoPlist = setGoogleMapsApiKey(config, infoPlist);\n infoPlist = setGoogleMobileAdsAppId(config, infoPlist);\n infoPlist = setGoogleSignInReservedClientId(config, infoPlist);\n return infoPlist;\n}\n\nexport function setGoogleServicesFile(config: ExpoConfig, projectRoot: string) {\n let googleServicesFileRelativePath = getGoogleServicesFile(config);\n if (googleServicesFileRelativePath === null) {\n return;\n }\n\n let googleServiceFilePath = path.resolve(projectRoot, googleServicesFileRelativePath);\n fs.copyFileSync(\n googleServiceFilePath,\n path.join(getSourceRoot(projectRoot), 'GoogleService-Info.plist')\n );\n\n let project = getPbxproj(projectRoot);\n let projectName = getProjectName(projectRoot);\n project = addFileToGroup(`${projectName}/GoogleService-Info.plist`, projectName, project);\n fs.writeFileSync(project.filepath, project.writeSync());\n}\n"]}
\No newline at end of file