Skip to content
This repository was archived by the owner on Apr 29, 2024. It is now read-only.

Commit 56aa9e2

Browse files
authored
Correct SimpleBackgroundTransfer sample to export optional protocol selectors (#410)
- Fixes #406 - Optional protocol methods must export if you use IFoo instead of Foo base class
1 parent 0a6947d commit 56aa9e2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

SimpleBackgroundTransfer/SimpleBackgroundTransfer/SimpleBackgroundTransferViewController.cs

+4
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public UrlSessionDelegate (SimpleBackgroundTransferViewController controller)
7979
this.controller = controller;
8080
}
8181

82+
[Export ("URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:")]
8283
public void DidWriteData (NSUrlSession session, NSUrlSessionDownloadTask downloadTask, long bytesWritten, long totalBytesWritten, long totalBytesExpectedToWrite)
8384
{
8485
Console.WriteLine ("Set Progress");
@@ -121,6 +122,7 @@ public void DidFinishDownloading (NSUrlSession session, NSUrlSessionDownloadTask
121122
}
122123
}
123124

125+
[Export ("URLSession:task:didCompleteWithError:")]
124126
public void DidCompleteWithError (NSUrlSession session, NSUrlSessionTask task, NSError error)
125127
{
126128
Console.WriteLine ("DidComplete");
@@ -137,11 +139,13 @@ public void DidCompleteWithError (NSUrlSession session, NSUrlSessionTask task, N
137139
controller.downloadTask = null;
138140
}
139141

142+
[Export ("URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:")]
140143
public void DidResume (NSUrlSession session, NSUrlSessionDownloadTask downloadTask, long resumeFileOffset, long expectedTotalBytes)
141144
{
142145
Console.WriteLine ("DidResume");
143146
}
144147

148+
[Export ("URLSessionDidFinishEventsForBackgroundURLSession:")]
145149
public void DidFinishEventsForBackgroundSession (NSUrlSession session)
146150
{
147151
using (AppDelegate appDelegate = UIApplication.SharedApplication.Delegate as AppDelegate) {

0 commit comments

Comments
 (0)