大家都知道,因为iOS5有一个原生的Twitter框架,可以很容易地从你的应用发布推文.
有没有办法提示将用户转发到设置应用程序并要求输入用户名和密码的警报?
我知道我可以使用以下代码解决问题:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=TWITTER"]];
Run Code Online (Sandbox Code Playgroud)
但那是没有文档的代码..
提前致谢
关心比利(我在SO上的第一篇文章)
对于iOS5,我们可以参考: 在iOS5中使用Twitter框架提示登录提醒?
但对于iOS6来说,我没有帮助,我已经尝试过以下方式,但有1个键盘外观问题存在是否有任何人可以帮助我这个:
SLComposeViewController *tweetSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
tweetSheet.view.hidden=TRUE;
[self presentViewController:tweetSheet animated:YES completion:^{
[tweetSheet.view endEditing:YES];
}];
Run Code Online (Sandbox Code Playgroud) 在iOS 5.0中我从我的应用程序打开Twitter设置
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=TWITTER"]];
但是,此功能在iOS 5.1中被删除,因此我无法打开Twitter设置.
现在我正在使用
+ (void)makeRequestsWithURL: (NSURL *)url {
// Create an account store object.
ACAccountStore *accountStore = [[ACAccountStore alloc] init];
// Create an account type that ensures Twitter accounts are retrieved.
ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
[self canTweetStatus];
// Request access from the user to use their Twitter accounts.
[accountStore requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error) {
if(granted) {
// Get the list of Twitter accounts.
NSArray *accountsArray = [accountStore accountsWithAccountType:accountType];
// For the sake …Run Code Online (Sandbox Code Playgroud) 在iOS5上可以提示并指导用户访问Twitter Settings.app区域,以便他们可以将自己的Twitter帐户添加到手机中吗?如果是这样你怎么做?
作为一种解决方法,我可以指导他们打开Settings.app,但就此而言.