admin管理员组文章数量:1122832
I tried setting up an API-key for Google Cloud that can be used from my Expo-managed android app. I got the fingerprint by running eas credentials
and set the restriction in Google Cloud to only Match android apps with this fingerprint.
When implementing react-native-geocoding, I got the following error when trying to fetch data from the API:
this ip, site or mobile application is not authorized to use this api key. request received from ip address XX.XX.XX.XXX, with empty referer
with status REQUEST_DENIED
.
When I remove the restrictions for the API-key, I can easily access the API.
What could be causing this? Am I maybe using the wrong fingerprint for the development version? If so, where can I find the correct one?
I tried setting up an API-key for Google Cloud that can be used from my Expo-managed android app. I got the fingerprint by running eas credentials
and set the restriction in Google Cloud to only Match android apps with this fingerprint.
When implementing react-native-geocoding, I got the following error when trying to fetch data from the API:
this ip, site or mobile application is not authorized to use this api key. request received from ip address XX.XX.XX.XXX, with empty referer
with status REQUEST_DENIED
.
When I remove the restrictions for the API-key, I can easily access the API.
What could be causing this? Am I maybe using the wrong fingerprint for the development version? If so, where can I find the correct one?
Share Improve this question asked Nov 22, 2024 at 16:59 JaRoMasterJaRoMaster 1811 gold badge4 silver badges32 bronze badges 2- Have you created android key or browser key? – Suraj Commented Nov 25, 2024 at 2:24
- @Suraj I used Expo EAS to build the app which generates the key. For another build, I used expo prebuild, which led to another key being created that also didn't work – JaRoMaster Commented Nov 25, 2024 at 19:27
1 Answer
Reset to default 0Run .\\gradlew.bat signingReport
or ./gradlew signingReport
to get the SHA-256 fingerprint. While you might have restricted the API key to a specific IP address, which makes no sense for a mobile application: https://developers.google.com/maps/documentation/geocoding/get-api-key
Instead of a completely unrestricted API key, one should put a public web-server in between.
本文标签: androidGoogle Cloud API does not recognize my Expo SHA1 fingerprintStack Overflow
版权声明:本文标题:android - Google Cloud API does not recognize my Expo SHA-1 fingerprint - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736302145a1931431.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论