Laurence Fan Laurence Fan - 1 year ago 87
iOS Question

openURL not work in Action Extension

I add following code:

- (IBAction)done {
// Return any edited content to the host app.
// This template doesn't do anything, so we just echo the passed in items.

NSURL *url = [NSURL URLWithString:@"lister://today"];
[self.extensionContext openURL:url completionHandler:^(BOOL success) {
NSLog(@"fun=%s after completion. success=%d", __func__, success);
[self.extensionContext completeRequestReturningItems:self.extensionContext.inputItems completionHandler:nil];


after I create the Action Extension target. But it can not work.

My purpose is that: when user view a photo in (the iOS's default or called gallery), and he click the share button to launch our extension view.
We can transfer the image from to my own app and deal or upload the image in my app.

I also try "CFBundleDocumentTypes" but it also can not work.

Any help will be appreciated.

Answer Source

This is by design. We don't want Custom Actions to become app launchers.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download