【问题标题】:YouTube subscribe button in iphone appiPhone 应用中的 YouTube 订阅按钮
【发布时间】:2011-03-24 15:09:32
【问题描述】:

如何向 iPhone 应用程序添加订阅 YouTube 频道的按钮?

我尝试使用:

-(void)subscribe:(id)sender
    {
        NSString* str = [NSString stringWithFormat:@"%@%@",@"http://www.youtube.com/subscription_center?add_user=",YouTubeUserName];
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
    }

但这显示了一个 Youtube 屏幕,其中我有一个登录/登录按钮。按下登录时会导致 404 页面未找到错误。

有什么建议吗?

谢谢

【问题讨论】:

  • 这个工作:-(void)subscribe:(id)sender { NSString* str = [NSString stringWithFormat:@"%@%@",@"http://m.youtube.com/profile?gl=US&warned=True&client=mv-google&hl=en&user=",YouTubeUserName]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]]; }

标签: iphone objective-c youtube subscribe


【解决方案1】:

我建议使用Youtube's API 来完成这项工作。它更复杂,因为您需要事先对用户进行身份验证,但这是完成此操作的更彻底和无缝的方法。

【讨论】:

  • 好的,但我将如何使用订阅 API?有代码示例吗?
  • Google 的 GData examples 应该可以帮助您入门。
  • 这与是否使用任何 xml webservice SOAP 非常相似。 icodeblog.com/2008/11/03/…
  • 已经看到了,但没有订阅示例。我说的是 iphone api。
  • 您需要模仿已经存在的调用并简单地插入订阅方法。存在一个示例 YouTube 客户端 here。我还没有看到已经制作的用于订阅的 Objective-C 示例,因此您必须从那里获取它。
猜你喜欢
  • 1970-01-01
  • 2017-11-15
  • 2012-07-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-07-20
相关资源
最近更新 更多