diff --git a/app.config.js b/app.config.js index 11ff6cc..7ce7456 100644 --- a/app.config.js +++ b/app.config.js @@ -1,14 +1,26 @@ -// Config dinĂ¡mica: toma app.json como base e inyecta la API key de Google Maps -// desde la variable de entorno GOOGLE_MAPS_API_KEY (secreto de EAS), para no -// commitearla. En local puedes exportarla antes de `npx expo run:android`. +// Config dinĂ¡mica: inyecta las API keys de Google Maps (Android e iOS) desde +// variables de entorno / secretos de EAS, para no committearlas. +// Android: GOOGLE_MAPS_API_KEY +// iOS: GOOGLE_MAPS_IOS_KEY (solo necesario si se usa Google Maps en iOS; +// por defecto la app usa Apple Maps en iOS y no requiere key) module.exports = ({ config }) => { - const apiKey = process.env.GOOGLE_MAPS_API_KEY; - if (apiKey) { + const androidKey = process.env.GOOGLE_MAPS_API_KEY; + if (androidKey) { config.android = config.android || {}; config.android.config = { ...(config.android.config || {}), - googleMaps: { apiKey }, + googleMaps: { apiKey: androidKey }, }; } + + const iosKey = process.env.GOOGLE_MAPS_IOS_KEY; + if (iosKey) { + config.ios = config.ios || {}; + config.ios.config = { + ...(config.ios.config || {}), + googleMapsApiKey: iosKey, + }; + } + return config; }; diff --git a/app.json b/app.json index e05b765..b059743 100644 --- a/app.json +++ b/app.json @@ -7,7 +7,9 @@ "icon": "./assets/icon.png", "userInterfaceStyle": "light", "ios": { - "supportsTablet": true + "supportsTablet": true, + "bundleIdentifier": "group.mai.avante", + "buildNumber": "1" }, "android": { "package": "group.mai.avante", diff --git a/eas.json b/eas.json index df8c051..3e958e1 100644 --- a/eas.json +++ b/eas.json @@ -9,21 +9,30 @@ "distribution": "internal", "android": { "buildType": "apk" + }, + "ios": { + "simulator": true } }, "preview": { "distribution": "internal", "android": { "buildType": "apk" - } + }, + "ios": {} }, "production": { "android": { "buildType": "app-bundle" - } + }, + "ios": {} } }, "submit": { - "production": {} + "production": { + "ios": { + "appleId": "Javier.Brana@mai.group" + } + } } } diff --git a/src/ui/FeatureMap.tsx b/src/ui/FeatureMap.tsx index 02ae934..ebaecf5 100644 --- a/src/ui/FeatureMap.tsx +++ b/src/ui/FeatureMap.tsx @@ -7,8 +7,12 @@ */ import * as Location from 'expo-location'; import React, { useMemo, useRef } from 'react'; -import { StyleSheet, Text, TouchableOpacity, View } from 'react-native'; -import MapView, { Marker, Polygon, Polyline, PROVIDER_GOOGLE } from 'react-native-maps'; +import { Platform, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; +import MapView, { Marker, Polygon, Polyline, PROVIDER_DEFAULT, PROVIDER_GOOGLE } from 'react-native-maps'; + +// Android usa Google Maps (requiere GOOGLE_MAPS_API_KEY). +// iOS usa Apple Maps por defecto (sin key, PROVIDER_DEFAULT). +const MAP_PROVIDER = Platform.OS === 'android' ? PROVIDER_GOOGLE : PROVIDER_DEFAULT; import { Feature } from '../api/types'; import { COLORS } from './components'; import { geometryToShapes, LatLng, regionFor } from './geojson'; @@ -70,7 +74,7 @@ export function FeatureMap({