首页 > 解决方案 > 适用于 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 分钟。如果我犯了任何错误,请告诉我。

标签: iosappcelerator-titaniumios-background-mode

解决方案


推荐阅读