Tweet post failed, tweet dialog doesn't appear

ios

#1

Hi, I have facing an issue in Twitter Sharing (Link).
Steps are:-

  1. Install Twitter app, login into that.
  2. Open your own app and share (in my case I am sharing video link), Tweet dialogue appears, and post it.
  3. Minimize your app (don’t kill),delete twitter app.
  4. Open your app from background and share. Now nothing happens, no dialogue nothing.

I am sharing you code and logs from XCode console

Code

    [[Twitter sharedInstance] logInWithViewController:SharedAppDelegate.window.rootViewController methods:TWTRLoginMethodAll completion:^(TWTRSession * _Nullable session, NSError * _Nullable error)
     {
	if (session != nil)
{
TWTRComposer *composer = [[TWTRComposer alloc] init];
    
    NSString *strVideoURL = self.videoModal.mediaURL;
    NSString *strText = [NSString stringWithFormat:@"Check out this video on %@ %@",AppName,strVideoURL];
    [composer setText:strText];
    [composer setURL:[NSURL URLWithString:strVideoURL]];
   [composer showFromViewController:SharedAppDelegate.window.rootViewController  completion:^(TWTRComposerResult result)
     {
         if (result == TWTRComposerResultCancelled)
         {
             NSLog(@"Tweet composition cancelled");
         }
         else
         {
             NSLog(@"Sending Tweet!");
         }
     }];
}

}];

Logs when dialog doesn’t appear

2017-02-07 12:51:09.438932 AppName[4253:916529] [core] SLComposeViewController about to instantiate remote view controller with array of 1 NSExtensionItems
2017-02-07 12:51:09.441579 AppName[4253:916529] [core] viewDidAppear
2017-02-07 12:51:09.443916 AppName[4253:919859] [ops] plug-in <PKPlugin: 0x160b1410 com.apple.share.Twitter.post(6.71.1) 8F8A30F6-1548-40BB-ABAB-6CBD675DF7FF 3(0) /private/var/containers/Bundle/Application/FF8DE8CF-8230-4CF7-9EE5-39ED783502DA/Twitter.app/PlugIns/ShareExtension.appex> pre-screen sees activating state
2017-02-07 12:51:09.567534 AppName[4253:919859] [ops] Hub connection error Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.atebits.Tweetie2.ShareExtension" UserInfo={NSDebugDescription=connection to service named com.atebits.Tweetie2.ShareExtension}
2017-02-07 12:51:09.569232 AppName[4253:916529] [core] SLComposeViewController finished instantiate remote view controller (null) error Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.atebits.Tweetie2.ShareExtension" UserInfo={NSDebugDescription=connection to service named com.atebits.Tweetie2.ShareExtension} extension request identifier (null)
2017-02-07 12:51:09.569538 AppName[4253:916529] [core] HOST: Failed to load remote view controller with error: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.atebits.Tweetie2.ShareExtension" UserInfo={NSDebugDescription=connection to service named com.atebits.Tweetie2.ShareExtension}
2017-02-07 12:51:09.569718 AppName[4253:916529] [core] Sheet not being presented, calling premature completion
2017-02-07 12:51:09.570216 AppName[4253:916529] [core] SLComposeViewController completeWithResult: 0
2017-02-07 12:51:09.570403 AppName[4253:916529] [core] SLComposeViewController automatically dismissing itself
2017-02-07 12:51:09.574980 AppName[4253:916529] [core] SLComposeViewController dealloc <SLComposeViewController: 0x16186090>
2017-02-07 12:51:09.575967 AppName[4253:916529] Tweet composition cancelled
2017-02-07 12:51:11.594668 AppName[4253:916529] [core] Prepared Request URL: https://api.twitter.com/oauth/access_token

#2

Hey @ab_jaihanuman, thanks for reporting this! I’ll share it with the team so we can investigate more. Happy coding :slight_smile:


#3

any update on this? @alexsinger


#4

Hey @alexsinger, could you please give me update on my posts, its more than a month, I haven’t got any update on this


#5

Based on the logs you shared, it looks like everything is working fine. Someone has opened a Tweet Composer, then when app is backgrounded the completion block is called with the TWTRComposerResultCancelled.


#6

@stevenhepting

No, its not like that. Please check the steps that I have mentioned.

  1. Install Twitter app, login into that.
  2. Open your own app and share (in my case I am sharing video link), Tweet dialogue appears, and post it.
  3. Minimize your app (don’t kill),delete twitter app.
  4. Open your app from background and share. Now nothing happens, no dialogue nothing.

Tweet Composer never appeared after this