0

I am an iOS newbie and I am used to programming in Java for Android. I am creating an app that creates a pdf file and gives the option to share to multiple sources like email, Dropbox, etc. In Android, this is simple just create a chooser based on the file type. In iOS though this seems a little more difficult.

I know how to create an Activities Sheet picker for iOS but it doesn't include Dropbox, only email and social networks.

My question is a simple one:

Do I need to create a separate button for Dropbox using the Dropbox API, or is there a different "Share file" Viewcontroller that I am just not finding?

I apologize if this has been asked before, but I didn't find a similar question/answer on SO. Thank you

Jim Stewart

1

You cannot send to DropBox using the UIActivitesViewController. The only available items to send your activity to are

 NSString *const UIActivityTypePostToFacebook;
 NSString *const UIActivityTypePostToTwitter;
 NSString *const UIActivityTypePostToWeibo;
 NSString *const UIActivityTypeMessage;
 NSString *const UIActivityTypeMail;
 NSString *const UIActivityTypePrint;
 NSString *const UIActivityTypeCopyToPasteboard;
 NSString *const UIActivityTypeAssignToContact;
 NSString *const UIActivityTypeSaveToCameraRoll;
 NSString *const UIActivityTypeAddToReadingList;
 NSString *const UIActivityTypePostToFlickr;
 NSString *const UIActivityTypePostToVimeo;
 NSString *const UIActivityTypePostToTencentWeibo;
 NSString *const UIActivityTypeAirDrop;

You can however use a UIDocumentInteractionController to send the pdf to the DropBox app if the user has it installed on their iOS device. The DropBox app registers for any file with a .pdf extension, so it will show up in the DocumentInteraction ActionSheet.

The third option you have is to create your own action sheet, and handle each button press if you wish to have DropBox, Facebook, and Twitter all on the same sheet. In this case yes you will have to handle all the OAuth and REST APIs yourself.

|improve this answer|||||
  • Thank you! UIDocumentInteractionController was exactly what I needed. – Jim Stewart Nov 23 '13 at 16:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.