Questions tagged [uiactivityviewcontroller]

The UIActivityViewController class is a standard view controller that you can use to offer various services from your application (on iOS).

The UIActivityViewController class is a standard view controller that you can use to offer various services from your application. The system provides several standard services, such as copying items to the pasteboard, posting content to social media sites, sending items via email or SMS, and more. Apps can also define custom services.

Resources:

1252 questions
37
votes
3 answers

Set different activity items for UIActivityViewController Swift

I have UIActivityViewController with 4 options: Message / Mail / TW / FB. I want to send different activities for each option! For eg: In iMessage sheet, I need to put : String, NSURL, and UIImage. In Mail I need to place string in Subject field,…
Bonnke
  • 896
  • 1
  • 12
  • 24
36
votes
4 answers

UIActivityViewController completion handler returns success when tweet has failed

I'm using a UIActivityViewController to display a share sheet so users can share my app. I'm currently testing tweets and i'm getting some unexpected results. On tweeting for the first time, all goes well. On the second time, i'm getting a duplicate…
Swinny89
  • 7,273
  • 3
  • 32
  • 52
34
votes
9 answers

iOS 13 UIActivityViewController automatically present previous VC after image saving

I'm trying to implement “Save image to Library” function and then return back to the current view controller, but on a new iOS 13 it dismisses back to the view controller that presented the current one: PHPhotoLibrary.requestAuthorization({(_…
Diana
  • 683
  • 1
  • 8
  • 17
33
votes
6 answers

How do I set recipients for UIActivityViewController in iOS 6?

I'm using the new UIActivityViewController class in iOS6 to provide the user with various sharing options. You can pass an array of parameters to it such as text, links and images and it does the rest. How do I define recipients? For example…
MattCheetham
  • 430
  • 1
  • 5
  • 10
31
votes
4 answers

iOS13 share sheet: how to set preview thumbnail when sharing UIImage

The new share sheet on iOS13 shows a preview/thumbnail of the item being shared on its top left corner. When sharing an UIImage using an UIActivityViewController I would expect a preview/thumbnail of the image being shared to be displayed there…
mmklug
  • 2,252
  • 2
  • 16
  • 31
30
votes
2 answers

can't exclude UIActivityTypePostToFacebook from [UIActivityViewController excludedActivityTypes]

I wish to create a UIActivityViewController which will exclude some of the native share features including Facebook and Twitter Share. But the Facebook share is still available as a ShareExtention. I create the following : activityViewController =…
Seamus
  • 1,107
  • 10
  • 22
29
votes
1 answer

UIActivityViewController Gmail Share subject and body going Same

I am sharing Some content via UIActivityController. It is working fine for other Options. I am able to get subject and body in Default Mail App. But when I use to share the content with gmail then my Subject of the mail is gone and I am getting Body…
Rahul
  • 5,594
  • 7
  • 38
  • 92
28
votes
1 answer

UIActivityViewController thinks my jpg is video when share by file URL

I have jpg files saved in the Documents directory that can be shared from a standard UIActivityViewController. All activity items (including Save Image) work as expected, but when Save Image is tapped, the following error shows in the console,…
Paul B.
  • 458
  • 3
  • 6
26
votes
4 answers

UIActivityViewController UIActivityViewControllerCompletionWithItemsHandler

List item Using Swift for an app that runs in iOS 8, I need to write a completion handler for the UIActivityViewController to capture the results of which "share" method a user selected. This is a snippet of the code I have so far. My question is…
Custom_Software
  • 501
  • 1
  • 4
  • 11
25
votes
6 answers

LaunchServices: invalidationHandler called - iOS 8 share sheet

Seeing this error message in the logs, though not consistently, around the time that I use SLComposeViewController to open a Twitter or Facebook share sheet. I am not using any new iOS 8 API, just testing existing code on iOS 8. I see others have…
Kyle Clegg
  • 38,547
  • 26
  • 130
  • 141
24
votes
4 answers

Different data for sharing providers in UIActivityViewController

I'm trying to use an UIActivityViewController with one long NSString as the data. If I put a string > 140 characters, the tweet sheet in it does not display the string. And if I truncate the string before giving it to the controller, all of the…
Mert Dümenci
  • 493
  • 1
  • 5
  • 18
23
votes
4 answers

UIActivityViewController taking long time to present

I made an app for iPhone. Now, I'm recreating it for iPad. When the user selects the action button in the toolbar, a popover should show with a UIActivityViewController, but for some reason, it's taking about 10 seconds for it to show the first…
22
votes
3 answers

How to share both Image and Text together in swift?

I am trying to share both image and text in swift. but when i choose to share via facebook, messenger or whatsapp it only gives text (image is not shared). I am using UIActivityViewController for sharing. here is my code: func…
hussain
  • 769
  • 2
  • 7
  • 24
22
votes
1 answer

Sending image + url in UIActivityViewController in Facebook Messenger

using a simple UIActivityViewController -(void)share{ NSString *textToShare = _mytext; NSURL *url = [NSURL URLWithString:@"http://www.google.com"]; UIImage *imageToShare = _myimage; NSArray *activityItems = @[textToShare, url, …
Nick Ginanto
  • 31,090
  • 47
  • 134
  • 244
21
votes
4 answers

Presenting UIActivityViewController from SwiftUI View

I'm trying to present a UIActivityViewController (share sheet) from a SwiftUI View. I created a view called ShareSheet conformed to UIViewControllerRepresentable to configure the UIActivityViewController, but it's turning out to be not as trivial to…
Kilian
  • 2,122
  • 2
  • 24
  • 42
1
2
3
83 84