Reputation: 119
i'm creating an app that's draw routes between users using only firestore to update users location.
the problem is to use direction api i need Restricted key using (server IP addresses) what should i do ? i don't have server i'm using only firestore
Upvotes: 0
Views: 1586
Reputation: 1542
Since your application is using a web service (Directions API), I believe you'll have to do the following to secure your API key:
More can be found in our public documentation On mobile apps that use Maps Web Service APIs of this Protecting API Keys
Upvotes: 1
Reputation: 587
For Android application, you may restrict your Google Maps API key with "Android apps" .
Based on the docs:
To restrict an API key:
- Go to the Google Cloud Platform Console.
- From the Project drop-down menu, select the project that contains the API key you want to secure.
- From the Navigation menu, select APIs & Services > Credentials.
- On the Credentials page, click the name of the API key that you want to secure.
- On the Restrict and rename API key page, set the restrictions: Application restrictions:
- Select Android apps and follow the instructions.
- Click + Add package name and fingerprint.
- Enter your package name and SHA-1 certificate fingerprint. For example:
com.example.android.mapexample
BB:0D:AC:74:D3:21:E1:43:67:71:9B:62:91:AF:A1:66:6E:44:5D:75
Upvotes: 0