Something went wrong. Try again.
Mirror — see github.com/blacksky-algorithms/blacksky.community
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344const {withInfoPlist} = require('expo/config-plugins')const plist = require('@expo/plist')const path = require('path')const fs = require('fs')
const withExtensionInfoPlist = (config, {extensionName}) => { return withInfoPlist(config, config => { const plistPath = path.join( config.modRequest.projectRoot, 'modules', extensionName, 'Info.plist', ) const targetPath = path.join( config.modRequest.platformProjectRoot, extensionName, 'Info.plist', )
const extPlist = plist.default.parse(fs.readFileSync(plistPath).toString())
// `config.scheme` may be an array when the app registers multiple URL // schemes; coerce to a single scheme so consumers reading it as a String // don't silently fall back to another app's scheme. extPlist.MainAppScheme = Array.isArray(config.scheme) ? config.scheme[0] : config.scheme extPlist.CFBundleName = '$(PRODUCT_NAME)' extPlist.CFBundleDisplayName = 'Blacksky Notifications' extPlist.CFBundleIdentifier = '$(PRODUCT_BUNDLE_IDENTIFIER)' extPlist.CFBundleVersion = '$(CURRENT_PROJECT_VERSION)' extPlist.CFBundleExecutable = '$(EXECUTABLE_NAME)' extPlist.CFBundlePackageType = '$(PRODUCT_BUNDLE_PACKAGE_TYPE)' extPlist.CFBundleShortVersionString = '$(MARKETING_VERSION)'
fs.mkdirSync(path.dirname(targetPath), {recursive: true}) fs.writeFileSync(targetPath, plist.default.build(extPlist))
return config })}
module.exports = {withExtensionInfoPlist}