How can I add Gmaps into my expo project?

Hello,

I’m trying to add Google Maps into my Expo project but I do not see ios.config.googleMapsApiKey in my app.json file :confused: Is there a command where it can be added automatically or do I need to put it manually to the app.json file? If so, what’s the format be like?

Btw, I’m following this documentation: MapView - Expo Documentation

I hope someone can help me with this :confused:

Thank you!

Hi

What is meant by ios.config.googleMapsApiKey is that in the ios part of app.json you need to make sure there’s a "config" key which has a value like:

{
  "googleMapsApiKey": "the-key-goes-here"
}

e.g.:

{
  "expo": {
    "name": "app name",
    "slug": "app-slug",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true,
      "config": {
        "googleMapsApiKey": "xxxxxxxx"
      }
    },
    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/adaptive-icon.png",
        "backgroundColor": "#FFFFFF"
      }
    },
    "web": {
      "favicon": "./assets/favicon.png"
    }
  }
}

Thank you!