[英]Receive Fence callbacks when app is killed
I'm using Fence Api in Google Awareness Api to create a geofence and trigger it when the user enters or exists the location. 我正在Google Awareness Api中使用Fence Api创建地理围栏,并在用户输入或存在该位置时触发它。 But this is working fine if the app is running.
但是,如果应用程序正在运行,则可以正常工作。 If the app is killed, I'm not receiving any status.
如果该应用程序被杀死,则我没有任何状态。
I've a static broadcast receiver in manifest which will receive the pending intent for fence callbacks. 我在清单中有一个静态广播接收器,它将接收篱笆回调的挂起意图。
I'm neither unregistering reciever nor the fence. 我既不注销收款人,也不是篱笆。
I don't know why I'm not able to receive the fence callbacks when the app is killed. 我不知道为什么该应用被杀死后为什么我无法接收围栏回调。
Try running the service as a foregroundservice and/or binding the service. 尝试将服务作为前台服务运行和/或绑定服务。 It'll be easier to answer if you post some code.
如果发布一些代码,回答起来会更容易。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.