I am trying to send an email(open the default mail client application) from my FinderSync extension.
let service = NSSharingService(named: NSSharingService.Name.composeEmail)
if(service != nil)
{
service!.recipients = ["[email protected]"]
service!.subject = "Test Mail"
if service!.canPerform(withItems: ["Test Mail body"])
{
service!.perform(withItems: ["Test Mail body"])
}
else
{
//fail for me
}
}
The same code executes from AppDelegate/ViewController while starting the main application but not working when calling from the extension.
FinderSync is an
NSExtension
which is not allowed to useNSSharingService
isShareKitPlugInService
is defined as