在ios5中使用twitter api我該如何着手讓用戶最初登錄? 我看到它是如何使用accounts.h如果用戶已經在設備上登錄,但有沒有辦法讓用戶到設置微博屏幕登錄,如果沒有Twitter帳戶已經登錄? 感謝ios 5 twitter初始登錄
0
A
回答
0
使用此代碼,如果設備上沒有帳戶的設置會轉移到設置頁面
-(void)postOnTwitter:(id)sender
{
TWTweetComposeViewController *twitter = [[TWTweetComposeViewController alloc] init];
[twitter addImage:self.imgView.image];
[twitter setInitialText:@"Photo From Application on iPhone"];
[self presentModalViewController:twitter animated:NO];
twitter.completionHandler = ^(TWTweetComposeViewControllerResult result)
{
[self dismissModalViewControllerAnimated:YES];
};
}
0
,或者你可以去到的iOS 5.0(通過[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=TWITTER"]];
設置頁面中添加,但它不應該在iOS版5.1)
工作爲
這是有點棘手,我得到去除子視圖中*TWTWeetComposeViewController*
,所以它當用戶沒有進入時只顯示警報,通過點擊設置按鈕,我們可以在我的應用程序中打開設置頁面。
+ (void)setAlertForSettingPage :(id)delegate
{
// Set up the built-in twitter composition view controller.
TWTweetComposeViewController *tweetViewController = [[TWTweetComposeViewController alloc] init];
// Create the completion handler block.
[tweetViewController setCompletionHandler:^(TWTweetComposeViewControllerResult result) {
[delegate dismissModalViewControllerAnimated:YES];
}];
// Present the tweet composition view controller modally.
[delegate presentModalViewController:tweetViewController animated:YES];
//tweetViewController.view.hidden = YES;
for (UIView *view in tweetViewController.view.subviews){
[view removeFromSuperview];
}
}
這裏,deleate是你的ViewController,如果您使用的是裏面的ViewController這種方法只使用self
,而不是delegate
。
+0
這在模擬器中不起作用,按下時的設置按鈕與取消效果相同。 –
相關問題
- 1. Twitter登錄始終顯示
- 2. 使用twitter登錄ios 7
- 3. iOS 5 Twitter API
- 4. 初始登錄到rails_admin
- 5. 登錄Spring初始化
- 6. 解析使用Twitter初始失敗登錄
- 7. ios 5屏幕初始自動旋轉
- 8. DotNetOpenAuth Twitter消費開始登錄
- 9. 的iOS 5.1模擬器Twitter登錄
- 10. 在ios上通過twitter實現登錄
- 11. 用於使用Twitter登錄的iOS庫
- 12. IOS Twitter的解析登錄與PFLogInViewController
- 13. IOS twitter登錄獲取request_token錯誤
- 14. iOS Twitter網站單點登錄
- 15. Twitter登錄電話差距爲Ios
- 16. Twitter Framework iOS - 登錄成功後
- 17. iOS 6原生Facebook/Twitter登錄信息
- 18. 如何在初始登錄後自動登錄用戶?
- 19. iOS 11 Facebook登錄正在顯示初始系統警報
- 20. 導航前的iOS初始登錄視圖控制器
- 21. Twitter登錄Quickblox
- 22. Twitter登錄iOS6
- 23. Twitter授權登錄
- 24. 初始化,連接和登錄時的初始屏幕
- 25. 登錄後正確初始化會話
- 26. Azure CLI初始化說無效登錄?
- 27. Rails的devise_ldap_authenticatable初始登錄失敗
- 28. ubuntu 11.10登錄回到初始屏幕
- 29. iOS 5 twitter的使用
- 30. 集成Twitter如IOS - 5
抱歉,這並不會將用戶轉移到我的設置頁面。只是警報 – glogic
好吧,我現在會更新我的答案,肯定會解決您的問題 –
這將顯示一個行動表,它給出選項去設置和設置帳戶的高音揚聲器 –