[英]How can I get location from background?
My problem is:我的问题是:
Save the user's location every 1 minute and after 15 minutes, push it to the server once.每 1 分钟保存一次用户位置,15 分钟后推送到服务器一次。 My approach is to create an underground thread.我的方法是创建一个地下线程。 After 1 minute, call the function to save into sqlite 1 time. 1分钟后,调用函数保存到sqlite 1次。 But how to run the function every 1 minute, in case the application is in the background then how to handle it.但是如何每1分钟运行一次该功能,如果应用程序在后台,那么如何处理它。
I found the plugin: background_fetch .我找到了插件: background_fetch 。 But it takes at least 15 minutes to run once.但是运行一次至少需要15分钟。
我试过了,它在前台和后台工作(但没有终止): background_location
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.