Questions tagged [nssharingservice]

9 questions
15
votes
5 answers

SwiftUI exporting or sharing files

I'm wondering if there is a good way export or share a file through SwiftUI. There doesn't seem to be a way to wrap a UIActivityViewController and present it directly. I've used the UIViewControllerRepresentable to wrap a UIActivityViewController,…
MScottWaller
  • 3,321
  • 2
  • 24
  • 47
5
votes
0 answers

How to attach files using NSSharingService

I am preparing a Mail using NSSharingService. I mainly followed the advice given here: NSSharingService to send email and read email body Effectively I am calling [self.emailSharingService performWithItems:shareItems]; where shareItems is an…
david
  • 113
  • 10
4
votes
0 answers

I am using NSSharingService in my macOS Swift app. Is there any way to make sure the default mail client is configured with a valid account?

I am using NSSharingService to prepare an email with attachment for the user of my macOS app. My code is: let emailService = NSSharingService.init(named: NSSharingService.Name.composeEmail) if emailService.canPerform(withItems: [emailBody,…
Alfonso Tesauro
  • 1,730
  • 13
  • 21
2
votes
2 answers

NSSharingService: How to compare with the constants?

I want to do something when the user shared to - (void)sharingService:(NSSharingService *)sharingService didShareItems:(NSArray *)items { BOOL isSafariReadingList = [sharingService.description…
StuFF mc
  • 4,137
  • 2
  • 33
  • 32
1
vote
1 answer

Is there a way to include fields such as "BCC" and "CC" using NSSharingService?

Im wondering if there is a way to compose an email in Swift and have it populate fields such as CC and BCC. Currently I am using NSSharingService and it only appears to have the options for Recipient, Subject, and Body. I'm not married to using…
paull
  • 143
  • 6
1
vote
1 answer

NSSharingService performWithItems Hangs

I had a working share routine and now it is broken. Hadn't checked it, or modified it, for some time and now find that it is inoperable. When I call [sharingService performWithItems:[NSArray arrayWithObject:itemProvider]]; I get a share sheet…
Dean Davids
  • 4,174
  • 2
  • 30
  • 44
0
votes
1 answer

Sharing folder via NSSharingServicePicker on macOS 13 to iOS device

Within my app I am using NSSharingServicePicker to share exports. This all works fine on macOS 11 and macOS 12. On macOS 13 though there is a strange issue sharing folders to e.g. an iOS device running iOS 15 or iOS 16. This is not an issue sharing…
berbie
  • 978
  • 10
  • 13
0
votes
1 answer

SwiftUI: Sharing NSSharingService on macOS not receiving share

I have a simple test application that attempts to share a CoreData record with another user using NSSharingService. I can create my share and that works, but when I try to receive the share it opens up the application but doesn't do anything. I have…
iphaaw
  • 6,764
  • 11
  • 58
  • 83
0
votes
1 answer

Call NSSharingService from FinderSync extension

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) { …
DAC84
  • 421
  • 1
  • 8
  • 20