地理围栏-触发"GEOFENCE_NOT_AVAILABLE"时出现问题 [英] Geofence - problem in triggering 'GEOFENCE_NOT_AVAILABLE'

查看:174
本文介绍了地理围栏-触发"GEOFENCE_NOT_AVAILABLE"时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用地理围栏做应用程序,因为我开始使用它,因此我开始广播过渡接收器,当我关闭GPS位置时,我收到了代码GEOFENCE_NOT_AVAILABLE的警报,并且我启动了一项服务来重新注册地理围栏打开GPS. 现在我休息了几天,当我关闭GPS时,我的broadcastReceiver突然没有收到警报.我不明白为什么? *当我从位置进入/退出时(如我在geofences init中定义的那样),我会触发警报,问题仅出在GEOFENCE_NOT_AVAILABLE警报的触发上.

I do app with geofencing use and since I started to work with it I get to broadcastReceiver the transitions and when I turned off the GPS location I got an alert with code GEOFENCE_NOT_AVAILABLE and I started a service to reregister the geofences when I will turn on the GPS. Now I took a few days break and suddenly my broadcastReceiver doesn't get alerts when I turn off the GPS. I don't understand why? *when I enter/exit from location (like I defined in the geofences init) I trigger the alerts, the problem is just at the triggering of the GEOFENCE_NOT_AVAILABLE alert.

如果有人能帮助我,我会很高兴

I will glad if anyone can help me

推荐答案

GEOFENCE_NOT_AVAILABLE是预期的错误代码,以通知您位置适配器已关闭并且不再跟踪位置(和地理围栏).

GEOFENCE_NOT_AVAILABLE is an expected error code, to let you know that the location adapter is off and location (and geofence) will not be tracked anymore.

再次可用时,您的地理围栏将处于活动状态,并且您将获得所需的回调.

Once available again, your geofences will be active and you will get the desired callback.

未触发的一些原因:

  1. 检查您在地理围栏请求中设置的到期时间戳是否仍然有效.
  2. 您是否已重启设备?如果是,则需要重新注册围栏. (请参阅文档:仅在以下情况下重新注册地理围栏所需文档)

您的位置是否在设备设置"中设置为高精度"模式?

Is your location, set to High Accuracy mode in Device settings ?

重新注册篱笆时,应先注销它们,然后再重新注册.

When you re-register your fences, you should un-register them first and then only re-register.

打开Goog​​le地图,检查其显示的位置是否正确.

Open Google maps and check if its showing the right location.

这篇关于地理围栏-触发"GEOFENCE_NOT_AVAILABLE"时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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