0

I have some files that want to share with any application. I use this code

var fileDAta = NSData.FromFile(path);

UIActivityViewController activityViewController = new UIActivityViewController
                        (new NSObject[]{ fileDAta }, null); //(items, null);

PresentViewController(activityViewController,true,null);

enter image description here

As you see, it should be more application but as a default, there is just the Mail App. it is the same for real device.. (I also installed Gmail and Outlook but there is not on the list or on the more list)

Anyway,when i select the Mail, it cannot be attached ..

enter image description here

What I should change?

0

1 Answer 1

1

Use the following code for sharing but remember respective applications(gmail,twitter etc) for sharing must be installed on your device and configured.

 UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems: fileDAta applicationActivities:nil];
activityVC.excludedActivityTypes = @[UIActivityTypePrint, UIActivityTypeCopyToPasteboard, UIActivityTypeAssignToContact, UIActivityTypeSaveToCameraRoll]; //or whichever you don't need
[self presentViewController:activityVC animated:YES completion:nil];
Sign up to request clarification or add additional context in comments.

1 Comment

thank you for your reply, but i would like to share with other apps like MS word, ms outlook, X, Y ..... I think it is about fileDAta type. I tried NSUrl, NSString... but its the same..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.