Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WindowsPhone 8.1: BackgroundTransferRequest TransferPreferences #11

Open
szymonlesisz opened this issue Sep 16, 2015 · 0 comments
Open

Comments

@szymonlesisz
Copy link

Hi,
I've just found a issue on WP 8.1
According to
https://msdn.microsoft.com/en-us/library/windows/apps/microsoft.phone.backgroundtransfer.transferpreferences%28v=vs.105%29.aspx?cs-save-lang=1&cs-lang=csharp&f=255&MSPPError=-2147217396#code-snippet-1

BackgroundTransferRequest has TransferPreferences value set to None by default, which means it allow file transfer only (!) if you are connected to external power and WiFi.
In other case "transfer.TransferStatus" will have value "TransferStatus.WaitingForExternalPower" and script will not begin dowloading until you connect your phone to charger or computer.

I've done a workaround in src/wp/BackgroundDowload.cs @ line 74

transfer = new BackgroundTransferRequest(requestUri, downloadLocation);
transfer.TransferPreferences = TransferPreferences.AllowCellularAndBattery;

But maybe you should consider to set this value as function optional parameter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant