1

I have a share extension where the user chooses a photo or video, which we then upload (a) to Amazon and then (b) the URL to our server. This can take some time and so if an error happens during the upload I would like to alert the user on screen.

I'm using the SLComposeServiceViewController, which has a "Post" button (calling didSelectPost()). When tapped, it initiates the whole sequence, but immediately removes the view from the screen. If an error occurs, it won't show it.

How can I keep using SLComposeServiceViewController, whilst showing the progress of the upload and any resulting errors?

theDuncs
  • 4,649
  • 4
  • 39
  • 63

1 Answers1

0

The SLComposeServiceViewController is present as long as you have not called [self.extensionContext completeRequestReturningItems:@[] completionHandler:nil];

In the autogenerated subclass of SLComposeServiceViewController it is invoked at the end of didSelectPost

Just delay the call to this method until you are finished uploading.

Torleif
  • 2,334
  • 3
  • 27
  • 28