I have an app using SLComposeViewController
to post tweets. It works fine if Twitter app is not installed on my device (iOS 9.3.2).
But if it's installed, my app says, tweet was posted. And when I open Twitter app is says:
"Tweet failed to send
Your Tweet couldn't be sent and has
been saved as a draft".
If I delete Twitter app, all works fine. And it worked fine earlier.
Is something changed in API? How can I tweet without drafts?
The code used to tweet:
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];
}
Also I have the following messages in device console:
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
Is it possible to tweet via SLComposeViewController
with installed Twitter app ?