What is the official flow for handling background transfer events in share extension?
Documentation clearly states that "lengthy" operations should not be performed in foreground, so we're required to "complete request" (dismissing the extension UI) before file upload is over. Thing is, no matter how i try, NSURLSession events are delivered to extension process, rather that containing app (unless i kill extension process with exit(0)). Problem is, transfer may fail, and there's no way to notify user: UI is dismissed, notifications are not avalable, containing app couldn't be called, etc.
So, I wonder, am I doing something wrong? What is the official way to do it? Is there any kind of tutorial/sample?
How extension is supposed to notify the user if transfer fails and is non-retryable? What's Apple's vision of this?
I can’t speak to Apple’s “vision” of anything, but the notification side of things is easy to take care of on modern systems via the UserNotifications framework, which can be used by both apps and extensions.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"