Tarik Benali
Tarik Benali

Reputation: 57

React Native Maps in Expo

I know we need to add an API key to view a Google map Then, if react-native-maps is integrated with Expo and we use MapView just by importing from React-native. So where to add the API key in native Map Expo ?

Upvotes: 1

Views: 3121

Answers (1)

fayeed
fayeed

Reputation: 2485

You need to add keys to in your app.json, here's the expo guide you look at expo guide

In app.json, copy the API key from android.config.googleSignIn to android.config.googleMaps.apiKey

It should look like this:

{
  "expo": {
    "ios": {
      "config": {
        "googleMapsApiKey": "YOUR_GOOGLE_MAP_API_KEY_HERE"
      }
    },
    "android": {
      "config": {
        "googleMaps": {
          "apiKey": "YOUR_GOOGLE_MAP_API_KEY_HERE"
        }
      }
    },
  }
}

Upvotes: 2

Related Questions