cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leif Ullman (JIRA)" <>
Subject [jira] [Updated] (CB-2190) FileTransfer does not request more time than the 5 second limit when placed in background.
Date Sat, 19 Jan 2013 17:40:12 GMT


Leif Ullman updated CB-2190:

    Attachment: CDVFileTransfer.m

Proposed fix.  Add a UIBackgroundTaskIdentifier as a property of CDVFileTransfer.h.  Also
kick off upload to background (using beginBackgroundTaskWithExpiration) if using chunkedMode.
 Finally end the background task in the end of the connectionDidFinishLoading method.  This
appears to work for me in several test scenarios when kicking off multiple large uploads at
once (around 10-20mb each), then sending the application to the background.  
> FileTransfer does not request more time than the 5 second limit when placed in background.
> ------------------------------------------------------------------------------------------
>                 Key: CB-2190
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: iOS
>    Affects Versions: 2.2.0
>         Environment: iOS 6.0.1, Cordova 2.2.0.
>            Reporter: Leif Ullman
>            Assignee: Shazron Abdullah
>         Attachments: CDVFileTransfer.h, CDVFileTransfer.m
> I've been running into an issue using FileTransfer on iOS that cropped up as part of
my upgrade to Cordova 2.2.  Previously I had been on PhoneGap 1.2 (a long time between upgrades
I know).  When using the 1.2 version, I could start a filetransfer upload (using sample code
from here:
and it would continue to run if I returned to the home screen or if I locked the device. 
Now it appears that suspending the app will cause a FileTransferError to occur with error
code 3 and error message "The request timed out".  
> After trading some emails with Shazron, he pointed out that the limit to finish up background
tasks is 5 seconds.  If the task will take longer, the app has to request more time -- and
FileTransfer does not do this currently (although the CDVLocalStorage plugin in onResignActive

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message