承诺函数没有被调用? [英] Promise functions not being called?
本文介绍了承诺函数没有被调用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下是我所拥有的代码,其中在BackgroundDownloader.startDownloadAsync()之后根本没有调用任何promise函数。 我的应用程序在清单中定义了
Internet(客户端)功能。
Here is the code that I have where none of the promise functions are getting called at all after the BackgroundDownloader.startDownloadAsync(). My app has the Internet (Client) capability defined in the manifest.
有任何建议吗?
谢谢,
迈克尔
// Pin the series to the desktop
function pinSeries(e) {
var desiredName = "Series.jpg";
Windows.Storage.ApplicationData.current.localFolder.createFileAsync(desiredName, Windows.Storage.CreationCollisionOption.replaceExisting).then(function (localFile) {
var downloader = new Windows.Networking.BackgroundTransfer.BackgroundDownloader(),
uriLogo = new Windows.Foundation.Uri(seriesUrl);
downloader.startDownloadAsync(uriLogo, localFile).then(function (downloadResult) {
CreateTileAsync(localFile);
},
function (error) {
error;
},
function (progress) {
progress;
});
});
}
推荐答案
嗨迈克尔,
此代码是在后台任务中还是在应用程序中调用的? 我在背景任务中看到了类似的问题,这就是我要问的原因。
Is this code being called in a background task or in an application? I have seen similar issues in background tasks and that is why I am asking.
-Jeff
这篇关于承诺函数没有被调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文