应用程序在后台运行时的GeoFence设备 [英] GeoFence Device when app is in background

查看:173
本文介绍了应用程序在后台运行时的GeoFence设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实现了geoFence api,并且一切正常.但是有一些问题,我想进一步澄清我的困惑.

I have implemented the geoFence api and everything is working good. But there are some problems, I want more clarification regarding my confusions.

以下是一些困惑和问题:

  1. 我希望我的用户进入地理围栏区域时得到通知.我已经按照指南实施了 GeofenceTransitionsIntentService ,但是当应用程序在后台运行时,它不会触发过渡.我该怎么办?

  1. I want my user to get notified when he enters a geofenced area. I have implemented the GeofenceTransitionsIntentService as per guideline but it is not triggering the transition when the app is in background. What should I need to do?

GeoFence过期时间:很明显,如果我们输入从不,它不会过期,但是我对时间感到困惑.例如,如果我将其设置为10分钟,那到底能做什么?自创建以来,地理围栏是否会在给定的时间后过期,还是当用户到达该位置后计时器便会过期?用户到达那里时,如何使地理围栏过期.

GeoFence Expire time: it is pretty obvious that if we enter Never it is not going to expire, but I am confused about the time. For example if I set it to 10 minutes, what does that exactly do? Will the geofence expire after the given time since it is created or it would expire when the user arrives at that place and then the timer would start? How can we get the geofence to expire when the user gets there.

Google如何跟踪我们?地理围栏实际上是如何工作的?我们没有发送我们的位置,那么现在正在跟踪吗?当我们添加地理围栏时,它会开始跟踪我们,然后在到达该位置时通知我们吗?

How is Google tracking us? How does the geofence actually work? We are not sending our location, then now it is tracking ? Does it start tracking us when we add a geofence and then notify us when arrived at that place?

请告诉我并讨论这些困惑,尤其是我对在关闭或销毁该应用程序时它的运作感到困惑.

Please tell me and discuss about these confusions, especially my confusion about it working while the app is closed or destroyed.

推荐答案

关于1.)据此 Google I/O对话当您使用PendingIntents时,即使在后台运行,Location API仍应唤醒您的应用程序,尽管根据我的经验,地理围栏事件非常不可靠,但这可能与GPS不良有关我用于测试的设备中的接收器.

About 1.) According to this Google I/O Talk When you're using PendingIntents the Location API should wake up your app even if it's runnning in the background, although from my experience the Geofencing events are quite unreliable, but this might be related to a bad GPS receiver in the device I used for testing.

这篇关于应用程序在后台运行时的GeoFence设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆