Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ShareKit changes?

I haven't used ShareKit much, but I want to have only three sharing options: Facebook, Twitter, and Email. ShareKit gives far more options, including a More button. However, I don't want the More option, just the three.

In SHKActionSheet.m of ShareKit:

// Add More button
[as addButtonWithTitle:SHKLocalizedString(@"More...")];

enter image description here

like image 487
user755278 Avatar asked Jun 16 '11 12:06

user755278


3 Answers

It is super easy now, if you use ShareKit 2.0.

  1. edit SHKSharers.plist to include only sharers you need. In case you do not want to compile unused sharers files, check granular install.

  2. You can hide "more..." button in configurator. The new setting is - (NSNumber*)showActionSheetMoreButton

  3. You can disable favourites reordering in configurator. Normally last used sharer is on the top in ShareKit's action sheet. The new setting is - (NSNumber*)autoOrderFavoriteSharers

Using this way you do not need to change or add any code to ShareKit.

like image 130
Vilém Kurz Avatar answered Oct 15 '22 00:10

Vilém Kurz


I wanted to have the same thing. I spent days to make ShareKit work without too much success. Ok I was able to post FB, Twitter and Email messages but it was more pain the convenience.

Sharekit is an awesome idea but:

  • You cannot share image, URL and text at the SAME TIME! It has to be text only, URL only or Image only. Probably you want your user to post something on FB or Twitter or send an email about your App. What's the point if the message cannot contain an App Store or webpage link?
  • Very badly documented often you have to post questions on StackoverFlow
  • It's buggy, not supported by the original designer so there are dozens of forks. You can pick the ShareKit fork, but still.
  • On it's website it sounds like it's a drag and drop and you can make it work in minutes, good luck for that.

It takes 5 lines to add twitter, about 50 for Facebook and email to support text, URL and photo at the same time.

Twitter: This code sends a message with User editable text, URL (hidden, not editable) and an image. It took me 5 minutes to figure it out.

#import  <Twitter/TWTweetComposeViewController.h>

- (IBAction)twitterButton:(id) sender {
   TWTweetComposeViewController *tweetView = [[TWTweetComposeViewController alloc] init];
   [tweetView setInitialText:@"Check out this app, it's awesome" ];
   [tweetView addImage:[UIImage imageNamed:@"MyImage.png"]];
   [tweetView addURL:[NSURL URLWithString:appDelegate.appStoreURL]]; 
   [self presentModalViewController:tweetView animated:YES];
}

I really appreciate the effort of creating Sharkit but personally I cannot recommended it unless you really need to support all of those sharers and you happy with limited functionality.

UPDATE: I implemented Facebook sharing myself. It was more difficult than I thought. The main problem is that you cannot upload a photo with a post because Facebook only accept image links. Even worse Facebook does not allow to link to a photo which is uploaded to the user photo album (very easy) as it must be an external link. For static images you can use a URL shortener to get around it but for user generated images pretty much you have to use Amazon S3 or something else. Amazon S3 is super easy to use, I figured out how to use upload files in an hour or so.

like image 4
Tibidabo Avatar answered Oct 15 '22 01:10

Tibidabo


If you don't want the More... button, why don't you take out the line of code that adds it?

like image 3
Rob Napier Avatar answered Oct 15 '22 00:10

Rob Napier