0

I'm using TWTRComposerViewController to share video on twitter my landscape app, it is working fine in all other device's except iPhone-X , when i try to share video in iPhone-X then composer not showing and the App freezes out.

I'm using the below written code:

if ([[Twitter sharedInstance].sessionStore hasLoggedInUsers]) 
{

    dispatch_async(dispatch_get_main_queue(), ^{

       TWTRComposerViewController *composer = [[TWTRComposerViewController  emptyComposer] initWithInitialText:@"Testing" image:nil videoURL:url];
       composer.delegate = self;

      [self presentViewController:composer animated:true completion:nil];
    });

 } 
 else 
 {

       [[Twitter sharedInstance] logInWithCompletion:^(TWTRSession *session, NSError *error) {

                if (session) {

                dispatch_async(dispatch_get_main_queue(), ^{

                   TWTRComposerViewController *composer = [[TWTRComposerViewController  emptyComposer] initWithInitialText:@"Testing" image:nil videoURL:url];
                   composer.delegate = self;

                  [self presentViewController:composer animated:true completion:nil];

                  });


                } else {

           NSLog(@"Error");
       }

  }  
rmaddy
  • 314,917
  • 42
  • 532
  • 579
  • You seems to not be the only one: https://stackoverflow.com/questions/48831671/twtrcomposerviewcontroller-not-appearing-in-iphone-x-landscape or from Twitter Dev forums https://twittercommunity.com/t/problem-in-using-twtrcomposerviewcontroller-iphonex-ios11-x/99827/11 – Larme Feb 17 '18 at 18:30

1 Answers1

0

The glitch you are encountering with the TWTRComposerViewController is not your error, nor are you the only one dealing with this.

This is a bug in Twitter's SDK.

Looking into Twitter's recent activity / attention to their SDK it seems their interface packages are lagging ever since the new iPhone X release. I would expect this to be resolved sooner than later.


I guess the best temporary solutions would be to either force your controller into portrait mode during this process, disable rotation for the appropriate controllers, or (though perhaps too ugly) present this VC in portrait, and rotate the view. Nonetheless, hopefully Twitter updates their SDK soon.


Report this as a bug to Twitter on their developer forum to let them know about the issue, as they should eventually see the numerous posts of the same issue...

Will Von Ullrich
  • 2,129
  • 2
  • 15
  • 42