【问题标题】:After Successful twitter sharing call back not coming to my app成功的 twitter 分享回电后没有进入我的应用程序
【发布时间】:2014-10-27 17:29:54
【问题描述】:

我正在使用以下代码进行 twitter 分享。在这里,我正在检查设备中是否安装了 twitter 本机应用程序,然后我正在打开本机应用程序,否则我正在打开 webView 以进行 Twitter 共享。使用以下代码,我可以进行 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];

    }

成功分享后如何返回我的应用。

【问题讨论】:

    标签: ios iphone twitter


    【解决方案1】:

    你不能!一旦你启动了一个外部应用程序,你就不能回到你的应用程序,除非外部应用程序是专门以这种方式完成的(例如使用“回调”arg),但很少有“大牌”(twitter、facebook、.. .) 以这种方式工作

    如果您想使用 Twitter 但仍不退出应用,请使用 Twitter 框架 (https://developer.apple.com/library/ios/documentation/Twitter/Reference/TwitterFrameworkReference/_index.html)

    这有点复杂,但您将获得留在您的应用程序中的好处。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-26
      • 1970-01-01
      • 1970-01-01
      • 2017-09-10
      • 2023-03-21
      • 2013-07-03
      • 2019-11-03
      • 2013-01-03
      相关资源
      最近更新 更多