1

是否有任何教程可以将我的 iOS 6 应用程序与 Twitter 和 Google 集成。我进行了很多搜索,但找不到任何好的示例或代码。请任何人指导我。

4

1 回答 1

0

在 iOS 5,6 中将此代码用于 twitter。

if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
{
    SLComposeViewController *tweetSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
    [tweetSheet setInitialText:@"Tweeting from my own app! :)"];
    [self presentViewController:tweetSheet animated:YES completion:nil];
}
else
{
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Sorry" message:@"You can't send a tweet right now, make sure your device has an internet connection and you have at least one Twitter account setup" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alertView show];
}
于 2013-03-05T11:29:35.830 回答