错误在Android中加入地理围栏(状态code 1000) [英] Error adding geofences in Android (status code 1000)
问题描述
我收到了onAddGeofencesResult错误(INT状态code,的String [] geofenceRequestIds)与状态code回调= 1000。
I am getting error in the onAddGeofencesResult(int statusCode, String[] geofenceRequestIds) callback with statusCode = 1000.
我有我的GPS功能,我的无线网络连接。我也有谷歌播放服务,我能够追踪我的位置,并要求更新。为什么我不能添加地理围栏?我不能够甚至从文档示例应用程序添加地理围栏。我得到以下吐司消息:
I have my GPS enabled and my WiFi. I also have Google Play Services and I am able to track my location and request updates. Why am I not able to add geofences ? I am not able to add geofences even from the documentation sample app. I get the following Toast message:
添加地理围栏:失败,错误code 1000年GeofenceRequestIds = [1,2,1,2]
"Add Geofences: Failure, error code 1000 GeofenceRequestIds=[1,2,1,2]"
从文档(状态code 1000):
From the documentation (statusCode 1000):
公共静态最终诠释GEOFENCE_NOT_AVAILABLE
public static final int GEOFENCE_NOT_AVAILABLE
地理栅栏服务现在不可用。通常,这是因为用户关闭设置中的位置访问>的位置访问。
Geofence service is not available now. Typically this is because the user turned off location access in settings > location access.
恒值:1000(0x000003e8)
Constant Value: 1000 (0x000003e8)
推荐答案
您获得 GEOFENCE_NOT_AVAILABLE
(code 1000),当用户不同意使用谷歌的位置服务在设置 - >位置 - >模式:
You get GEOFENCE_NOT_AVAILABLE
(code 1000) when user disagrees to "Use Google' location services" in Settings->Location->Mode:
要解决这个问题:
- 进入设置 - >位置 - >模式结果
- 设置仅设备(使用GPS来确定您的位置)
- 设置任何其他选项,以获取弹出(例如高精确度(使用GPS,Wi-Fi和移动网络确定位置)
- 对话,使用谷歌定位服务显示
- 选择同意
这篇关于错误在Android中加入地理围栏(状态code 1000)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!