Hello,
I’m trying to use Constants.manifest.extra it works on iPhone but returns undefined on Android (genymotion)
Here is my app.json
{
"expo": {
"sdkVersion": "26.0.0",
"extra" : {
"apiUrl" : "http://192.168.1.102:8000/"
}
}
}
Js Code
import {Constants} from ‘expo’
import {Constants} from 'expo'
export const apiUrl = (path = '') => {
alert(
JSON.stringify(Constants.manifest.extra)
)
}
package.json
{
"name": "app",
"version": "0.1.0",
"private": true,
"devDependencies": {
"jest-expo": "26.0.0",
"react-native-scripts": "1.13.1",
"react-test-renderer": "16.3.0-alpha.1"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "jest"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"axios": "^0.18.0",
"expo": "^26.0.0",
"react": "16.3.0-alpha.1",
"react-native": "^0.54.4",
"react-navigation": "^1.5.10",
"react-redux": "^5.0.7",
"redux": "^3.7.2",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.2.0"
}
}
Any Ideas?
Thanks