TimeFence.inInterval in awareness API not working

I use this to set a temporary fence:

ArrayList<AwarenessFence> awarenessFences = new ArrayList<AwarenessFence();
awarenessFences.add(TimeFence.inInterval(timeInMillis, timeInMillis+5L));
AwarenessFence customFence = AwarenessFence.and(awarenessFences);

However, the fence does not fire when time falls between timeMillis and timeMillis + 5L. My receivers are working properly, as all other fences are working properly. What could be the problem behind TimeFence not working?

+4
source share
1 answer

The question does not contain enough information to identify a potential problem. From testing, a specific time fence works as expected. I can do my best by pointing out some common problems.

  • TimeFence.inInterval, - . , ( ).

  • 5 , . , , , , , .

  • , timeMillis System.currentTimeMillis(), 5 , , , API. , .

+1

Source: https://habr.com/ru/post/1662338/


All Articles