Can I bypass the tweet dialog and send a message directly to twitter?

I use ShareKit to implement Twitter share. I have a view controller with a text view and you want to send this text to a message in ShareKit, bypassing the tweet input dialog.

SHKItem *item = [SHKItem text:[postText text]];
[SHKTwitter shareItem:item];

The above code authenticates the user if he is not logged in, then takes my text and fills the tweet dialog in ShareKits. Digging through their code, I was confused. Could anyone successfully post a tweet directly to twitter?

+5
source share
1 answer

First create an instance SHKTwitterand authorize the user:

twitter = [SHKTwitter new];
[twitter authorize];

Then, after user authorization, configure the item and send it.

SHKItem *item = [SHKItem new];
[item setCustomValue:@"i am tweeting" forKey:@"status"];
twitter.item = item;
[twitter send];

"status" SHKTwitter. SHKItem, . SHKFacebook:

item.shareType = SHKShareTypeText;
item.text = "hi";
+6

All Articles