后台代理(PeriodicTask)不能自行更新 [英] Background agent (PeriodicTask) not updating by itself

查看:65
本文介绍了后台代理(PeriodicTask)不能自行更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序可以作为后台代理启动定期任务.在调试模式下,我将其设置为每60秒自动更新一次,并且可以正常工作.但是,当我在手机(和模拟器)上使用发行版时,后台代理 不会自行更新.到目前为止,我已经等待了70分钟,并且后台代理程序本身并没有被单独调用.

I have an application that starts a periodic task as a background agent. In debug mode, I set it to automatically update every 60 seconds, and it works flawlessly. However, when I use the release version on my phone (and the emulator), the background agent does not update by itself. I have waited 70 minutes thus far and the background agent is simply not being invoked on its own.

任何帮助将不胜感激.

推荐答案

通过转到设置应用程序检查其是否已打开(在设备中)- >背景剂->您的应用.

Check that its turned on (in device) by going to the settings app -> Background Agent -> Your App.

如果已设置,则在代码开始时(在您编写任何其他内容之前)显示敬酒消息.等待30到35分钟.  如果您看到吐司消息,则表示您的应用程序(代理)在执行过程中崩溃了 您编码.

If thats set show a toast message right at the beginning of your code (before anything else you have written).  Wait the 30 to 35 minutes.  If you see your toast message than it means you app (agent) is crashing during the execution of you code.

建议使用try catch块,并在catch上使用toast消息,以将异常通知您(如果有的话)

Recommend using try catch blocks and use toast message on the catch to notify you of the exception (if any)

祝你好运

Harold(Zumicts-创始人)

Harold (Zumicts - Founder)


这篇关于后台代理(PeriodicTask)不能自行更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆