I have the following code to send a URL
through AirDrop
:
NSString* selfUrlScheme = [[[[[[NSBundle mainBundle]
This question has been posted a looong time ago. I tried @Ivan's answer as well as other answers in the post, however, they just do not work!
What I have originally is the image on the left. I am sharing custom data via AirDrop and looked at the title that is generated by UIActivityController
by default "data-3A4F9D...", orz. What I want to achieve is a more descriptive title so that it is more readable for the recipient (image on the right). It seems that it is extremely similar to your question (even though I am sharing NSData
while you are sharing NSURL
.
Here is what I do, which works pretty well: implement the following UIActivityItemSource
protocol within my UIActivityItemProvider
.
- (NSString *)activityViewController:(UIActivityViewController *)activityViewController
subjectForActivityType:(NSString *)activityType
{
// This returning string is added to the email title
return NSLocalizedString(@"CustomTitle", nil);
}
If you are still having this problem, feel free to give this a try and let me know how it works for you.