我正在开发一个总是在后台运行的BLE应用程序.它从BLE外设获取与健康相关的数据,并将数据实时上传到服务器.我使用的NSURLSession一起NSURLSessionUploadTask创建的使用[NSURLSession uploadTaskWithRequest:myRequest fromFile:fileURL]将数据发送到服务器.
现在,应用程序在后台运行4-5小时,但之后iOS会杀死应用程序.
这是崩溃日志.
Date/Time: 2014-04-02 19:32:11.694 -0700
OS Version: iOS 7.0.4 (11B554a)
Report Version: 104
Exception Type: 00000020
Exception Codes: 0x000000008badf00d
Highlighted Thread: 2
Application Specific Information:
MyApp[2548] has active assertions beyond permitted time:
{(
<BKProcessAssertion: 0x15d83310> identifier: Background Content Fetching (66) process: MyApp[2548] permittedBackgroundDuration: 30.000000 reason: backgroundContentFetching owner pid:33 preventSuspend preventThrottleDownUI preventIdleSleep preventSuspendOnSleep
)}
Elapsed total CPU time (seconds): 1.300 (user 1.300, system 0.000), 2% CPU
Elapsed application CPU time (seconds): …Run Code Online (Sandbox Code Playgroud)