I was using Pocket and they seem to have created a share extension that simply posts the URL to their service w/o a UI.
Anyone have an idea on how to replicate this? I'm new to extensions but very familiar with iOS/Objective-C
The main feature of share extensions is to make your content preview correctly on Workplace. This entails providing support for authenticated preview metadata in a format Workplace expects, such that when URLs to your content are shared, Workplace can fetch that metadata and create a preview.
Overview. Using the iOS share sheet, users can launch your messaging app instantly from a list of suggestions when sharing content like a link, image, video, or file.
App Extensions are an iOS feature that allows developers to extend the functionality and content of their app beyond the app itself, making it available to users in other apps or in the main operating system.
Figured it out.
Just don't use the built in SLComposeServiceViewController
@interface ShareViewController : UIViewController
@end
And make sure to call the following function when done with the share extension
[self.extensionContext completeRequestReturningItems:@[] completionHandler:nil];
In other words, replace the contents of ShareViewController.swift
with:
import UIKit
class ShareViewController: UIViewController {
override func viewDidLoad() {
extensionContext?.completeRequest(returningItems: [], completionHandler: nil)
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With