[英]How can I open a Twitter tweet using the native Twitter app on iOS?
Safari可以使用以下格式的鏈接打開推文:
http://twitter.com/1Direction_X/statuses/197752514391715842
在iOS 5上,Twitter是內置的。 如何使用從我的應用程序調用的本機Twitter應用程序打開上述推文?
這是您從自己的訪問其他應用程序的方式。 只需找到要發送訪問狀態的正確網址即可。 我已經列出了一個應該包含大多數重要列表的列表。 包括狀態發現。
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"twitter://status?id=12345"]];
微博://用戶SCREEN_NAME = lorenb
嘰嘰喳喳://用戶ID = 12345
嘰嘰喳喳://狀態ID = 12345
嘰嘰喳喳://時間表
Twitter的://提到
Twitter的://消息
嘰嘰喳喳://列表SCREEN_NAME = lorenb&蛞蝓= ABCD
嘰嘰喳喳://消息帖=你好%20world
Twitter的://留言信息=你好%20world&in_reply_to_status_id = 12345?
嘰嘰喳喳://搜索查詢=%23hashtag
注意:確保用戶安裝了Twitter或這會導致崩潰非常重要。 所以我建議在嘗試將它們發送到twitter之前在if語句中添加它。
[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"twitter://"]];
我會采用以下方法......
NSURL *twitterURL = [NSURL URLWithString:@"fb://profile/<profile_id>"];
if ([[UIApplication sharedApplication] canOpenURL:twitterURL]) {
[[UIApplication sharedApplication] openURL:twitterURL];
} else {
WebViewViewController *secondView = [self.storyboard instantiateViewControllerWithIdentifier:@"webinterface"];
secondView.headerLabel = @"Facebook";
secondView.webPath = @"https://www.facebook.com/pages/<link_for_page>";
[self.navigationController pushViewController:secondView animated:YES];
}
在WebViewViewController
我有webview,我在那里打開鏈接...
基本上它就像你在iPhone上沒有Twitter,它將在WebView中打開...
如果已經回答了這個問題我很抱歉,但是使用主題標簽發布消息的架構是:
twitter://post?message=hello%20world%23thisisyourhashtag.
只需將thisisyourhashtag
替換為您希望用戶發布的主題標簽即可。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.