ios - 适用于 iOS 的 Appcelerator Titan 中的后台服务
问题描述
我在后台服务中遇到了一些问题。我已经注册了后台服务,例如:var service = Ti.App.iOS.registerBackgroundService({url:'/bgservice.js'}); 在 bgservice.js 中:我实际上想检查数据库(数据执行时间> 8 分钟)并触发本地通知。但它不起作用。所以先尝试这样的示例,看看应用程序处于活动状态的时间在后台:
var timer = setInterval(startsampletest, 6000);
startsampletest();
function startsampletest(){
count=count+1;
Ti.API.info("1.!!!!!*******startsampletest is called for"+count);
}
每 6 秒只给我 5 次,所以它只执行 30 分钟(如果我错了,请纠正我)但是在 axway 文档中它说 bgservice 将激活 10 分钟。谁能帮我解决这个问题。我希望应用程序在后台运行 10 分钟。如果我犯了任何错误,请告诉我。
解决方案
推荐阅读
- c# - 将阻止列表禁止 Azure
- c# - 如何找到与我的 alt 代码匹配的字符
- nginx - Nginx http2_push 问题
- xtext - 如何在类型属性的完成/更改时触发操作?
- android - 添加片段时如何显示按钮?
- android - Firebase 存储无法下载适用于 Android OS 16 的文件
- php - 使用Phonegap cordova时带有php的XMLHttpRequest返回脚本
- reactjs - React Native Animation 不再启动。是不是我做错了什么?
- asp.net-web-api - 如何在 webapi 中验证 azure 活动目录令牌
- google-analytics - 使用 Analytics 进行单页应用程序跟踪:仪表板中没有虚拟页面浏览量