I'va subclassed UIActivityItemProvider to be able to choose what to share if the user choose Facebook or Twitter or Mail etc. But I can only share text OR image in the function - (id)item, I don't know how to share both text and image for example.
If I read tutorials I know how to do for all share options, but I don't want all share option to have an image or a link or text :
NSArray* dataToShare = @[someText, [NSURL URLWithString:url], image];
UIActivityViewController* activityViewController =
[[UIActivityViewController alloc] initWithActivityItems:dataToShare
applicationActivities:nil];
Found it
CustomActivityItemProvider *itemProvider = [[CustomActivityItemProvider alloc] init];
UIActivityViewController* activityViewController =
[[UIActivityViewController alloc] initWithActivityItems:@[itemProvider, image]
applicationActivities:nil];
This will use my CustomActivityItemProvider where I choose the text and the image will be used if the share option choosed is compatible (facebook, twitter etc)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With