Reputation: 628
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
Upvotes: 8
Views: 3118
Reputation: 1
handle extension as per below below in share extension's viewdidload: works
[self.extensionContext completeRequestReturningItems:@[] completionHandler:blah];
Upvotes: 0
Reputation: 628
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)
}
}
Upvotes: 14