Why the key api ( google ) does not work when adding key constraint

Asked

Viewed 360 times

0

I have 2 key api, one with restriction for android apps and the other without, when I put the app to use the restricted api it can not access the api returning Error "403 Forbidden", in the unrestricted api everything works normally.

Already check the SHA-1 and the package and everything seems correct. api com restrição

  • You generated sha-1 as a release?

  • i did it using this tutorial: https://stackoverflow.com/questions/27609442/how-to-get-the-sha-1-fingerprint-certificate-in-android-studio-debug-mode

  • If you generated sha-1 debug, then it should work, just put the generated key in your project.

  • No projeto que você diz, no android studio ou na restrição da api no console do google? se for android onde eu coloco ?

  • See this image: https://i.stack.Imgur.com/u4Ppn.png On the third screen is google_maps_api.xml. Instead of YOUR_KEY_HERE. you must put the key that generated on the google console.

  • I have already done this, however from the error when I access using the key q has restriction, this is the problem =/

  • I don’t understand. What is this restriction?! Where?! In the app?! You have already given access to internet in Manifest?!

  • Look at the image you have in the post, I have a key with the option "none" and this with the key restriction for "android apps", the key with restriction does not work, and the unrestricted works

  • Here’s the thing, you can restrict this key only to Android to work only in your app. If released, it will work on both the web and android, or Ios etc, but you run the risk of someone trying to use your key on another website if you manage to steal this key. This causes, if you theme too much access, exceed your free quota of access to the google maps api. = D

  • It’s probably not working in your app because you got some of your tutorial procedures wrong, or it might not be quite right because there’s some update. Because also that answer ai is 2015.

  • I have the same problem: When registering the key restriction for apps for android, my app can no longer access. I am sure about the package name and also SHA1, because I use firebase.

Show 6 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.