AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
![]() ![]() I've published the code for my extension as well if you want to have a look. Note: Alternatively you could call supers -didSelectPost, which will similarly complete the extension context. For example, an app like Pocket has it enabled, but if a user selects some text in Safari and then tries to share via the context menu, Pocket can't do anything meaningful with just the plaintext and no page URL, so it just pops up a pretty cryptic error message. If the only purpose of an extension is the share URLs, and plain text without a URL isn't a sensical use case, you should probably not have NSExtensionActivationSupportsText set to YES. Which means that the plist object returned to the extension has both the URL of the page and the selectedText. Here's the test.js file: var GetURL = function() ) NSExtensionActivationSupportsWebURLWithMaxCount NSExtensionActivationSupportsWebPageWithMaxCount Here's the NSExtension section of my ist: NSExtension The first step to setting up a share extension is, well, creating the extension itself. Selected content and the webpage URL is shared to a remote server via an HTT call.User selects my App Extension in the sharing menu that comes up from the bottom.User selects some content (text and images) and waits for context menu to appear.Click on the More button to the right of the other share icons and turn on the switch for your extension & then select Done. On the first run, you will need to add your extension to the share sheet. User is browsing a webpage in iOS Safari. Once the extension starts running, select a photo and tap on the Share button.Note: Alternatively you could call super's -didSelectPost, which will similarly complete the extension context.ĮxtensionContext?.I'm trying to achieve the following user flow: Customize nearly one hundred aspects of the Apple and Windows file servers. Inform the host that we're done, so it un-blocks its UI. Swift Share also gives you more than just start and stop controls for the powerful file servers built-in to Mac OS X. Let task = session.dataTask(with: request! as URLRequest) Let request = urlRequestWithImage(image: attachedImage, text: contentText) Let session = URLSession(configuration: sessionConfig) SessionConfig.sharedContainerIdentifier = "group.CreateDaily" Extensions aren't allowed their own cache disk space. Let sessionConfig = URLSessionConfiguration.background(withIdentifier: configName) Selected content and the webpage URL is shared to a remote server via an HTT call. User selects my App Extension in the sharing menu that comes up from the bottom. Do the upload of contentText and/or NSExtensionContext attachments. In the extension, we retrieve the path of the shared image along with the ContextText value from the ShareViewController form. User selects some content (text and images) and waits for context menu to appear. This is called after the user selects Post. This is my code that initiates the background upload: let sc_uploadURL = "" // ![]() The share extension works fine and it shows up in Preview, once I run it: Just call it Share or whatever name you prefer. I'm still testing this so any requests will be sent to. Go into the project section, click on the + button and select the Share extension from the list. I created an macOS ShareExtension which I want to use to upload pictures. ![]()
0 Comments
Read More
Leave a Reply. |