【问题标题】:ios: Tweeting with SLComposeViewController saves tweet to Draft if Twitter app installedios:如果安装了 Twitter 应用程序,使用 SLComposeViewController 发送推文会将推文保存到草稿
【发布时间】:2018-12-24 20:14:05
【问题描述】:

我有一个应用程序使用SLComposeViewController 发布推文。如果我的设备上没有安装 Twitter 应用程序(iOS 9.3.2),它可以正常工作。 但是,如果它已安装,我的应用程序会说,推文已发布。当我打开 Twitter 应用程序时说:

"推文发送失败
你的推文无法发送并且已
已保存为草稿”。

如果我删除 Twitter 应用程序,一切正常。而且之前效果很好。
API有什么变化吗?我如何在没有草稿的情况下发推文?

用来发推文的代码:

if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) {
    SLComposeViewController* tweetVC = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
    [tweetVC setInitialText:t];
    tweetVC.completionHandler = ^(SLComposeViewControllerResult result) {
        switch (result) {
            case SLComposeViewControllerResultCancelled: …; break;
            case SLComposeViewControllerResultDone:      …; break;
        }
        [vc dismissViewControllerAnimated:YES completion:nil];
    };
    [vc presentViewController:tweetVC animated:YES completion:nil];
}

我在设备控制台中也有以下消息:

Jun 12 14:40:50 zxPad2 pkd[5937] <Warning>: assigning plug-in com.apple.share.Twitter.post(6.50) to plugin sandbox
Jun 12 14:40:50 zxPad2 pkd[5937] <Warning>: enabling pid=6180 for plug-in com.apple.share.Twitter.post(6.50) 47151597-AD1B-4874-936B-C5A7D1D3E2F1 /private/var/containers/Bundle/Application/755F79DE-E26B-4FDD-B34D-C5937E406A3D/Twitter.app/PlugIns/ShareExtension.appex
Jun 12 14:40:50 zxPad2 ShareExtension[6183] <Warning>: host connection <NSXPCConnection: 0x126d44260> connection from pid 6180 invalidated
Jun 12 14:41:19 zxPad2 myapp[6180] <Notice>: 2016-06-12 14:41:19.023|myapp|0x13fd14c90: SLRemoteComposeViewController: (this may be harmless) viewServiceDidTerminateWithError: Error Domain=_UIViewServiceErrorDomain Code=1 "(null)" UserInfo={Terminated=disconnect method}
Jun 12 14:41:24 zxPad2 myapp[6180] <Warning>: plugin com.apple.share.Twitter.post invalidated

安装 Twitter 应用后是否可以通过 SLComposeViewController 发推文?

【问题讨论】:

    标签: ios twitter slcomposeviewcontroller


    【解决方案1】:

    我注意到在安装 Twitter 应用程序时,您必须登录 Twitter 帐户 vida OS > 设置才能解决此问题。

    【讨论】:

      猜你喜欢
      • 2018-06-19
      • 2013-08-08
      • 1970-01-01
      • 1970-01-01
      • 2013-08-26
      • 1970-01-01
      • 2013-11-27
      • 2017-09-20
      • 1970-01-01
      相关资源
      最近更新 更多