Search code examples
twitterswift3social-networkingswift4tweets

How to twitting in my profile use TwitterKit?


How to twitting in my profile use TwitterKit?

In dev.twitter.com i found how to create form and send but always i see error "Tweet failed to send"

let composer = TWTRComposer()

composer.setText("just setting up my Twitter Kit")
composer.setImage(UIImage(named: "twitterkit"))

// Called from a UIViewController
composer.show(from: self.navigationController!) { (result in
    if (result == .done) {
        print("Successfully composed Tweet")
    } else {
        print("Cancelled composing")
    }
}

Solution

  • In Application Management your twitter app need select "Read, Write and Access direct messages" in Permission.