1
我使用以下代碼進行twitter共享。在這裏,我正在檢查是否在設備中安裝了twitter本機應用程序,然後我打開本機應用程序,否則我打開webView以供Twitter分享。使用下面的代碼我能夠做推特分享,但問題是,成功分享回撥後沒有到我的應用程序,這是要推特應用程序。成功後,twitter共享回撥沒有進入我的應用程序
NSURL *instagramURL = [NSURL URLWithString:@"twitter://post?message=hello%20world"];
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
[[UIApplication sharedApplication] openURL:instagramURL];
} else {
// <a href="twitter://tweet?text=I share this on Twitter from a website">Share this on Twitter</a>
GenericWebViewController *gwvController=[[GenericWebViewController alloc] init];
[gwvController loadWithUrl:[NSURL URLWithString:@"https://twitter.com/intent/tweet?url=www.google.com&text=I%20am%20eating%20branston%20pickel%20right%20now&original_referer=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F9127808%2Fhow-do-you-include-hashtags-within-twitter-share-link-text"] navBarTitle:@"Twitter"];
UIBarButtonItem *newBackButton = [[UIBarButtonItem alloc] initWithTitle: @"" style: UIBarButtonItemStyleBordered target: nil action: nil];
[[self navigationItem] setBackBarButtonItem: newBackButton];
[self.navigationController pushViewController:gwvController animated:YES];
//WI-542:Showing the navigation bar in WebView when user user navigate from deal details.
[self.navigationController setNavigationBarHidden:NO animated:NO];
}
如何成功共享後回到我的應用程序。