android - 当应用程序处于后台或使用 mauron85/react-native-background-geolocation 关闭时,当应用程序进入静止状态时,服务器上的位置不会更新
问题描述
当应用程序处于前台或在用户移动时发送到后台时位置更新正确,但如果应用程序在应用程序关闭或后台位置停止更新时进入静止区域。即使我在应用程序从后台进入静止区域或终止状态后移动距离,它也不会退出静止区域并停止更新服务器上的位置。
环境:
React Native version: 0.59.9
Plugin version: 0.6.3
Platform: Android
OS version: 7
Device manufacturer and model: Redmi Note 4
插件配置选项:
BackgroundGeolocation.configure({
desiredAccuracy: 10,
stationaryRadius: 10,
distanceFilter: 5,
notificationTitle: 'Background Tracking',
notificationText: 'Enabled',
debug: true,
startOnBoot: true,
stopOnTerminate: false,
locationProvider: BackgroundGeolocation.DISTANCE_FILTER_PROVIDER,
interval: 5000,
url: url,
syncUrl: url,
httpHeaders: {
...this.props.headers
},
postTemplate: {
lat: '@latitude',
long: '@longitude',
id: id // you can also add your own properties`
}
})
解决方案
推荐阅读
- php - 使用 PHP 循环遍历 JSON 数组
- android - Android 插件中的 SurfaceTexture 在 Unity 中不起作用
- amazon-s3 - 以 S3 文件存在为条件的顺序脚本
- compression - aws sns 发布压缩有效负载
- excel - 如果存在重复项,则将计数修改为字符串,而不修改非重复项
- html - Flexbox SVG 没有内联其他元素
- ios - 如何为工作区设置 Jenkins Xcode 插件?
- git - SVN 到 git 的转换:分支形成
- reactjs - 在 react-native 中获取我的应用程序版本的干净方法
- spring-boot - org.thymeleaf.exceptions.TemplateProcessingException:在此上下文中只允许返回数字或布尔值的变量表达式