Skip to content

Commit

Permalink
feat: create eas config
Browse files Browse the repository at this point in the history
  • Loading branch information
sudjoao committed Oct 26, 2023
1 parent 6fabb89 commit 98cb2af
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 31 deletions.
6 changes: 3 additions & 3 deletions app/app.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

const { MAPS_API_KEY } = process.env;
const { MAPS_API_KEY, GOOGLE_SERVICES_JSON } = process.env;

export default ({ config }) => {
return {
Expand All @@ -15,13 +15,13 @@ export default ({ config }) => {
'READ_PHONE_STATE',
'WRITE_EXTERNAL_STORAGE',
],
googleServicesFile: './google-services.json',
googleServicesFile: GOOGLE_SERVICES_JSON,
config: {
googleMaps: {
apiKey: MAPS_API_KEY,
},
},
versionCode: 220,
versionCode: 303,
},
};
};
18 changes: 14 additions & 4 deletions app/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@
"name": "Mia Ajuda",
"slug": "miaajuda",
"privacy": "public",
"platforms": ["android", "ios"],
"platforms": [
"android",
"ios"
],
"notification": {
"icon": "./assets/images/logo.png",
"color": "#4b8ab9",
"androidMode": "default"
},
"version": "2.2.0 Mutt",
"extra": {
"eas": {
"projectId": ""
}
},
"version": "3.0.3 Corgi",
"orientation": "portrait",
"icon": "./assets/images/logo.png",
"splash": {
Expand All @@ -20,7 +28,9 @@
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": ["**/*"],
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.miaajuda.app"
Expand All @@ -42,4 +52,4 @@
]
}
}
}
}
35 changes: 19 additions & 16 deletions app/eas.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
{
"cli": {
"version": ">= 0.57.0"
"cli": {
"version": ">= 5.5.0"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"submit": {
"production": {
"android": {
"serviceAccountKeyPath": "./serviceAccountKey.json",
"track": "production"
}
},
"alpha_test": {
"android": {
"serviceAccountKeyPath": "./serviceAccountKey.json",
"track": "alpha"
}
}
"preview": {
"distribution": "internal"
},
"production": {
"android": {
"buildType": "apk"
}
}
}
},
"submit": {
"production": {}
}
}
4 changes: 2 additions & 2 deletions app/src/config/envVariables.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import Constants from 'expo-constants';
import { IP_ADDRESS, HOMOLOG_API } from '@env';

const prodUrl = 'http://164.41.92.25:8000/';
const homologUrl = `https://${HOMOLOG_API}/`;
const devUrl = `http://${IP_ADDRESS}:8000/`;
const homologUrl = 'http://164.41.92.25:8000/'
const devUrl = 'http://164.41.92.25:8000/'

const ENV = {
dev: {
Expand Down
10 changes: 6 additions & 4 deletions app/src/services/Firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ import {
onAuthStateChanged,
} from 'firebase/auth';
import Constants from 'expo-constants';
import authConfig from '../config/authmiaajuda-firebase';
import authConfigDev from '../config/authmiaajuda-firebase-dev';
const { AUTH_CONFIG_JSON, AUTH_DEV_CONFIG_JSON } = process.env
console.log(process.env)
// console.log(AUTH_CONFIG_JSON)
// const authConfig = JSON.parse(AUTH_CONFIG_JSON);
// const authConfigDev = JSON.parse(AUTH_DEV_CONFIG_JSON);

class FirebaseService {
constructor() {
const env = Constants.manifest.releaseChannel;
const { apiKey, authDomain, projectId } =
env == 'prod' ? authConfig : authConfigDev;
const { apiKey, authDomain, projectId } = {};
this.app = initializeApp({
apiKey,
authDomain,
Expand Down
4 changes: 2 additions & 2 deletions app/src/store/contexts/userContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import actions from '../actions';
import env from '../../config/envVariables';

import {
getCurrentPositionAsync,
getLastKnownPositionAsync,
requestForegroundPermissionsAsync,
} from 'expo-location';
import callService from '../../services/callService';
Expand Down Expand Up @@ -42,7 +42,7 @@ export const UserContextProvider = (props) => {
async function getLocation() {
const { granted } = await requestForegroundPermissionsAsync();
if (granted) {
const { coords } = await getCurrentPositionAsync({
const { coords } = await getLastKnownPositionAsync({
enableHighAccuracy: true,
});
const { latitude, longitude } = coords;
Expand Down

0 comments on commit 98cb2af

Please sign in to comment.