Google Places API + ReactNative

问题描述 投票:1回答:1

我正在尝试在Android应用中使用Google Places API。我正在使用React Native和以下软件包:https://github.com/FaridSafi/react-native-google-places-autocomplete

  1. 已在Google控制台中创建API密钥
  2. 设置为Android应用的限制(SHA1指纹+包名称)
  3. SHA1指纹和包装名称值通过以下方法检查:
    • aapt转储标记的app-release.apk
    • 解压缩-p app-release.apk META-INF / CERT.RSA | keytool -printcert
  4. API密钥没有任何API使用限制(可以与任何服务一起使用]
  5. 已启用Places API
  6. 启用了Maps JavaScript API
  7. 已启用适用于Android的Maps SDK

A)设置了Android应用限制时(第2点)。我收到错误消息:

“ Google地方信息自动填充:未授权该IP,网站或移动应用使用此API密钥。收到来自IP地址xxx.xxx.xxx.xxx的请求,引用者为:undefined”

B)删除Android应用限制(限制设置为“无”时,一切正常。

有什么想法吗?

android react-native google-places-api
1个回答
0
投票

尝试这个:

react-native-places-input

没有依赖关系,可以与expo一起使用。

© www.soinside.com 2019 - 2024. All rights reserved.