Open Share Extension

Hello, everyone!

Help me please to find answer. I have two applications: App-1 with share extension and App-2 without it. From the second app I can open share extension via UIActivityViewController. But I need this extension in the second application to open immediately by pressing a button, and not through UIActivityViewController. Can I do this?

@Valeriadt did you ever find a solution for this? I have the same need right now and can't find anything relevant

Many years later, I came up with a solution:

This is only possible via the private API, Using VK as an example:

NSExtension *shareExtension = [NSExtension extensionWithIdentifier: @"com.vk.vkclient.shareextension" error:nil];

self.vkExtension = shareExtension;//Strong reference otherwise it will be released

if (extension) {
    SLComposeViewController *shareVC = 
    [SLComposeViewController composeViewControllerForExtension:shareExtension];   
    [self presentViewController:shareVC animated:YES completion:nill];
}

Many years later, I came up with a solution:

This is only possible via the private API, Using VK as an example:

NSExtension *shareExtension = [NSExtension extensionWithIdentifier: @"com.vk.vkclient.shareextension" error:nil];

self.vkExtension = shareExtension;//Strong reference otherwise it will be released

if (extension) {
    SLComposeViewController *shareVC = 
    [SLComposeViewController composeViewControllerForExtension:shareExtension];   
    [self presentViewController:shareVC animated:YES completion:nill];
}
Open Share Extension
 
 
Q