Question

I am going to allow sharing from my app, including FB, Twitter and email. For that, I am using UIActivityViewController. When the user chooses email, is there any way to know the recipients the mail was sent to? I don't actually even need to know the addresses, but just how many recipients the mail was sent to.

The signature of the completion handler makes me think that we can only inspect the activity type and whether the action was completed.

If this is not possible, what is the best approach to obtain this functionality?

Was it helpful?

Solution

This is not possible to do with UIActivityViewController, or really with any system classes. MFMailComposeViewController allows you to set the recipients, but the user could add or delete recipients, so there is no way to know for sure to whom the message was sent.

To know exactly which recipients were selected, you'd have to roll your own mail compose view controller (which would not have access to the user's mail accounts), which means you'd also have to roll your own replacement for UIActivityViewController.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top