Xojo example project
An example Xojo project to show how to use NSSharingService in Xojo-built Applications (macOS, 64Bit only). The following services are implemented in the example project:
- Compose Email (Subject, Content, Attachments)
- Compose Message (Content/Text, File/Attachments)
- Send via AirDrop (Files/Attachments)
Example application - SharingService: AirDrop

Example application - SharingService: Messages

Example application - SharingService: E-Mail

Xojo is a rapid application development for Desktop, Web, Mobile & Raspberry Pi.
The Desktop application Xojo example project NSSharingService.xojo_project is using:
- Xojo 2026r1.2
- API 2
- copy the Module
modNSSharingServiceto your project. - you can then use the provided convenience methods:
modNSSharingService.SendViaAirDrop()modNSSharingService.ComposeMessage()modNSSharingService.ComposeEmail()
Note:
- These methods return
trueif the sharing service can be invoked,falseif the service is not available. - The Sharing Service will run asynchrously (e.g. when not called to show modally within a window). That's why you can pass a
ResultCallbackDelegate, which will be invoked and reported back with the result later (e.g.: successfully shared, cancelled by user, ...).
Juerg Otter is a long term user of Xojo and working for CM Informatik AG. Their Application CMI LehrerOffice is a Xojo Design Award Winner 2018. In his leisure time Juerg provides some bits and pieces for Xojo Developers.
Do you like this project? Does it help you? Has it saved you time and money?
You're welcome - it's free... If you want to say thanks I'd appreciate a message or a small donation via PayPal.