合作咨询
我们的专家服务团队将竭诚为您提供专业的合作咨询服务
Class Info |
|---|
public class GeofenceService 地理围栏,程序定位交互接入类。在调用LocationServices类的getGeofenceService(Activity activity)或getGeofenceService(Context context)方法时返回一个该类型的实例。 |
Qualifier and Type | Method Name and Description |
|---|---|
Task<Void> | createGeofenceList(GeofenceRequest geofenceRequest, PendingIntent pendingIntent) 通过传入PendingIntent的方式添加地理围栏,当触发围栏的时候,会通过广播通知。 |
Task<Void> | deleteGeofenceList(List<String> geofenceRequestIds) 通过地理围栏请求Id移除地理围栏。 |
Task<Void> | deleteGeofenceList(PendingIntent pendingIntent) 通过添加地理围栏请求时对应的PendingIntent移除地理围栏。 |
Method |
|---|
public Task<Void> createGeofenceList(GeofenceRequest geofenceRequest, PendingIntent pendingIntent) 通过传入PendingIntent的方式添加地理围栏,当触发围栏的时候,会通过广播通知。 |
Parameters
Name | Description |
|---|---|
geofenceRequest | 地理围栏请求对象。 |
pendingIntent | 每个地理围栏请求关联的PendingIntent,构造PendingIntent时需设置Class、Action,不能构造空Intent。 |
Returns
Type | Description |
|---|---|
Task<Void> | 任务,可以通过添加onComplete(Task task)回调接受添加结果,如果task.isSuccessful()为true,则代表添加地理围栏成功;否则添加失败。 |
需要用户App重新下发地理围栏的场景:
Method |
|---|
public Task<Void> deleteGeofenceList(List<String> geofenceRequestIds) 通过地理围栏请求ID移除地理围栏。 |
Parameters
Name | Description |
|---|---|
geofenceRequestIds | 待移除的地理围栏请求IDs。 |
Returns
Type | Description |
|---|---|
Task<Void> | 任务,可以通过添加onComplete(Task task)回调接受移除结果,如果task.isSuccessful()为true,则代表移除地理围栏成功;否则移除失败。 |
Method |
|---|
public Task<Void> deleteGeofenceList(PendingIntent pendingIntent) 通过添加地理围栏请求时对应的PendingIntent移除地理围栏。 |
Parameters
Name | Description |
|---|---|
pendingIntent | 待移除的地理围栏请求对应的PendingIntent。 |
Returns
Type | Description |
|---|---|
Task<Void> | 任务,可以通过添加onComplete(Task task)回调接受移除结果,如果task.isSuccessful()为true,则代表移除地理围栏成功;否则移除失败。 |
合作咨询
我们的专家服务团队将竭诚为您提供专业的合作咨询服务
解决方案
精准高效的一站式服务支持,助力开发者商业成功