firebase - Expo React Native 的地点 API 自动完成的替代方案

标签 firebase react-native expo google-places-api google-places-autocomplete

我正在使用 React Native、Expo 和 Firebase 开发一个应用程序,我需要使用 API 在用户键入位置时自动完成位置,但地方 API 非常昂贵。我想知道是否有任何免费的或至少便宜得多的react-native-google-places-autocomplete 软件包的替代品?理想情况下,它可以与 expo 和 firebase 一起使用。任何帮助将不胜感激,谢谢!

最佳答案

我建议您 fork react-native-google-places-autocomplete包,并将对Google的api调用替换为其他服务。或者只是为其编写自己的代码。

  • 在发送 API 请求之前添加冷却时间,并且在输入 4 个字母之前不要查询,例如,以大幅减少 API 调用。

替代 API 服务:

此处地理编码自动完成 https://developer.here.com/documentation/examples/rest/geocoding_suggestions

  • 每月前 3 万次搜索免费

LocationIQ https://locationiq.com/docs#autocomplete

  • 每天免费 5000 个请求

Mapbox 地理编码 https://docs.mapbox.com/api/search/geocoding/#forward-geocoding

  • 每月免费 10 万

可能还有很多我还没有找到的其他替代方案。

关于firebase - Expo React Native 的地点 API 自动完成的替代方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71714305/

相关文章:

react-native - 播放音频文件,源 => {uri : 'remote-file-path' } not working - React Native (expo)

ios - 当应用程序在后台时 didReceiveRemoteNotification 不使用 Firebase 调用

react-native - Expo 不适用于 firebase 模拟器

javascript - 如何通过 Hooks 在 React Native 中使用 refs?

react-native - React Native TypeError : undefined is not an object (evaluating 'props.getItem' )

javascript - React Native 项目的增强现实 (AR)

react-native - 如何修复以代码 1 退出的 Metro Bundler 进程

javascript - 如何使用动态输入从 Firestore 查询数据

firebase - 当数据库中发生时间事件时如何发送 FCM?

firebase - 如何批量删除 Firebase 匿名用户