简体   繁体   English

科尔多瓦背景地理定位无法在背景上工作

[英]cordova background geolocation not working on background

We have a location based cross platform app built using Ionic. 我们有一个使用Ionic构建的基于位置的跨平台应用程序。 We had built the ability to receive notifications based on the user location using the christocracy plugin at : https://github.com/christocracy/cordova-plugin-background-geolocation . 我们已经建立了使用christocracy插件根据用户位置接收通知的功能,该插件位于: https : //github.com/christocracy/cordova-plugin-background-geolocation

Unfortunately, this works only when the app is open. 不幸的是,这仅在打开应用程序时有效。 Besides, there is a display in the android drawer that background location is on. 此外,Android抽屉中还有一个显示背景位置的显示器。

We are unable to find an option where we can obtain user location even after the app is closed and serve notifications based on the user's location. 我们无法找到一个选项,即使关闭应用程序后也无法获取用户位置,并且无法根据用户的位置提供通知。 Please suggest any solution or plug-in which can solve the purpose. 请提出任何可以解决此问题的解决方案或插件。

Currently there is no such plugin available that can fetch you location co-ordinates for the device while your app is in background / suspended / killed. 目前,尚无此类插件可在您的应用处于后台/挂起/终止状态时为您获取设备的位置坐标。

You must develop native android cordova plugin which can do so for you. 您必须开发本机android cordova插件才能为您做到。 Remember this will involve Native platform implementation. 请记住,这将涉及本机平台实现。

question might be old, but posting this might help others 问题可能很老,但发布此问题可能会对其他人有所帮助

using the following plugin you can fetch locations even if the application is in the background. 使用以下插件,即使应用程序在后台,您也可以获取位置。 it has options like 'stopOnTerminate' and 'startonboot' , which helps you getting you location updates even after the reboot or OS kills the app 它具有“ stopOnTerminate”“ startonboot”之选项,即使重新启动或操作系统终止了该应用程序,它也可以帮助您获取位置更新

https://github.com/mauron85/cordova-plugin-background-geolocation https://github.com/mauron85/cordova-plugin-background-geolocation

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM