に常に実行します:URLSessionTaskは、私は次のコードでURLSessionTaskを始めているエラー私のExtensionDelegateで
func scheduleNextURLSessionTask() {
let backgroundConfigObject = URLSessionConfiguration.background(withIdentifier: "myIdentifier")
let backgroundSession = URLSession(configuration: backgroundConfigObject, delegate: self, delegateQueue: nil)
let retrieveTask = backgroundSession.dataTask(with: URL(string: "https://api.wedtec.net/cryptocoins/index.php?bitcoin&simple")!)
retrieveTask.resume()
}
マイExtensionDelegateはもちろん、URLSessionDataDelegateを実装しています。 これは常にエラーになります。意味のエラーメッセージ以下のだろうトリガされます
func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?)
:
URLSessionTask didCompleteWithErrorオプション(エラードメイン= NSURLErrorDomainコード= -997 "バックグラウンド転送サービスへの失われた接続" のUserInfo = {NSErrorFailingURLKey = https://api.wedtec.net/cryptocoins/index.php?bitcoin&simple、NSErrorFailingURLStringKey = https://api.wedtec.net/cryptocoins/index.php?bitcoin&simple、NSLocalizedDescription =バックグラウンド転送サービス}のために失わ接続)
ここで間違っている可能性がどのような任意のアイデア? scheduleNextURLSessionTaskは、バックグラウンドプロセス(WKApplicationRefreshBackgroundTask)から呼び出されます。