0

I need to give my players an ability to post GIF replays ONLY to their Twitter accounts. I've managed to create a basic general sharing dialog but the problem is, I can't remove all irrelevant sharing options: Notes, Skype and etc. Long hours of fighting with iOS and no results. There are no activity types for the stuff I want to exclude, so adding it to "excludedActivityTypes" is impossible. Tweet Sheet didn't help either, it can't share GIFs.

Are there any other options, guys? Current implementation:

Current implementation

I want to do smth like this (just add FB to excluded activities):

I want to do smth like this (just add FB to excluded activities)

julia_v
  • 593
  • 3
  • 18
GameDevABC
  • 3
  • 1
  • 2
  • Using this past code fully working condition :https://stackoverflow.com/questions/37007067/ios-share-gif-animated-image-not-working/44041180#44041180 – Ramani Hitesh Oct 06 '17 at 07:28

2 Answers2

0

If you are only wanting to allow sharing of the animated GIF to Twitter, it doesn't make much sense to use the UIActivityViewController to display the share sheet with only one option.

Why not just build your own using the SLComposeViewController? You have greater control over the UI and it's fewer button presses for the user. To do so, you can take a look at the sample code provided in this tutorial.

wottle
  • 13,095
  • 4
  • 27
  • 68
  • Hey thanks! I'll try this out and mark this question closed if it'll work – GameDevABC Aug 16 '16 at 19:33
  • The tutorial you've posted here says "However, currently if you want to include animated GIFs in a tweet, you need to use SLRequest and roll your own UI" I don't know Obj C at all, are there any ways to use SLComposeViewController and SLRequest together without writing my own UI? – GameDevABC Aug 16 '16 at 23:21
  • Ok I've managed to integrate this beauty https://github.com/romaonthego/REComposeViewController, it works ok with iOS 9, so there were no problems with its deprecated state. – GameDevABC Aug 17 '16 at 11:12
0

// Use this code :by. Ramani Hitesh iOS developer)

    NSURL *imageUrl =[self.ImageArray objectAtIndex:currentPhotoIndex];
    NSString *path=imageUrl.absoluteString;
    NSArray *strings = [path componentsSeparatedByString:@"/"];
    NSString *mygif=[strings objectAtIndex:strings.count-1];

    NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
    NSString *dataPath = [documentsPath stringByAppendingPathComponent:@"/MrHRamani"];

    NSString *filePath = [dataPath stringByAppendingPathComponent:mygif];

    NSURL *urll=[NSURL fileURLWithPath:filePath];
    NSLog(@"imag %@",imageUrl);
    self.documentationInteractionController.delegate = self;
    self.documentationInteractionController.UTI = @"net.whatsapp.image";
    self.documentationInteractionController = [self setupControllerWithURL:urll usingDelegate:self];
    [self.documentationInteractionController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES];
Ramani Hitesh
  • 214
  • 3
  • 15