【发布时间】:2021-07-08 04:05:54
【问题描述】:
Expo docs 提到能够从app.config.js 读取/更改app.json 的内容。我正在尝试从 app.config.json 设置 Google Maps API 密钥(当前位于 app.json 中)。但我无法从app.config.js阅读它
app.json
{
...
"android": {
"config": {
"googleMaps": {
"apiKey": "xxx" //set this from app.congif.js in order to use .env variable
}
}
}
}
app.config.js
export default ({ config }) => {
console.log(config.android)
//set key here
return {
...config,
};
};
console.log 的结果是undefined
【问题讨论】:
标签: react-native google-maps expo react-native-maps