miahelf
miahelf

Reputation: 824

How can I add a "share" option to an iOS/iPhone or Android image gallery?

I'm trying to add either a "share" option to iOS or Android phone galleries, or else another menu option that will perform the same task. I would like to start with iOS if it is possible. For example, if you go to your image gallery on an iPhone or Android phone, there is a share button, and you can choose Email, Picasa, Facebook, Twitter, etc depending on the phone. I need to add something like that to share it to my own web site or app.

If anyone has an idea of even a starting point to start reading that would be helpful!

Upvotes: 1

Views: 5606

Answers (2)

Hoang Nguyen Huu
Hoang Nguyen Huu

Reputation: 1252

From iOS 6, you can use this approach:

NSString* someText = self.textView.text;
NSArray* dataToShare = @[someText];  // ...or whatever pieces of data you want to share.

UIActivityViewController* activityViewController = 
[[UIActivityViewController alloc] initWithActivityItems:dataToShare 
                                  applicationActivities:nil];
[self presentViewController:activityViewController animated:YES completion:^{}];

But on iOS 5, Sharekit is the only way as far as i know.

Upvotes: 1

magma
magma

Reputation: 8520

on iOS, you can use ShareKit:

ShareKit : Drop-in Share Features for all iOS Apps

on Android, use ACTION_SEND:

Sharing content in Android using ACTION_SEND Intent

Upvotes: 5

Related Questions