简体   繁体   English

如何从后台获取位置?

[英]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.

相关问题 如果我开启了位置服务,那么进入后台模式后如何杀死我的应用? - If I have location services turned on then how can my app get killed when it enters background mode? 即使应用在iOS中被杀死或从后台删除,我如何继续更新我的位置? - How Can I Continue updating my location even when app is killed or removed from background in ios? 如何在iPhone的背景模式下获取当前位置? - How do i get the current location in the background mode in iPhone? 我如何使用“用于位置更新的应用程序注册”后台模式在后台播放音频文件 - how can i play an audio file in background using “App registers for location updates” background mode 是否可以在IOS中将用户位置与背景中的特定位置保持距离? - Is it possible to get distance from user location to specific location in background in IOS? 如何获得MKPolyline上的等距位置? - How can can I get equidistant location on a MKPolyline? 当位置发生变化且我的应用程序处于后台时,我可以获得本地通知吗? - Can I get a local notification when location changes and my app is in background? 我可以从xcode获取位置箭头,重新加载,搜索按钮吗? - Can I get an location arrow, reload, search buttons from xcode? iOS越狱 - 如何在后台获取位置 - iOS jailbreak - how to get location in background 如何定期获取位置并将位置发送到后台ios9中的服务器 - How to get location periodically and send location to server in background ios9
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM