sujith E
sujith E

Reputation: 214

Why in HMs Location Awareness enter barrier, status change to FALSE after few seconds while executing the application?

When I am using HMS Location Awareness enter barrier, status change to FALSE after few seconds while executing the app. I am not getting any error on execution. How can solve the issue?

Upvotes: 1

Views: 28

Answers (1)

Nithin
Nithin

Reputation: 972

In LocationBarrier three methods are there

  1. enter
  2. exit
  3. stay

The enter and exit barriers status will change to FALSE after five seconds. So if you need status to be TRUE whenever you are in a particular location you have to use stay barrier.

In stay barrier you have to mention minimum stay time in the specified area.

Syntax:

public static AwarenessBarrier stay(double latitude, double longitude, double radius, long timeOfDuration)

You can refer the below link to know more about Location Awareness.

https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201302980400000072&fid=0101187876626530001&pid=0301303616533430214

Upvotes: 1

Related Questions