iphone应用程序中的YouTube订阅按钮
如何在iPhone应用程序中添加一个订阅YouTube频道的按钮 我尝试使用:iphone应用程序中的YouTube订阅按钮,iphone,objective-c,youtube,subscribe,Iphone,Objective C,Youtube,Subscribe,如何在iPhone应用程序中添加一个订阅YouTube频道的按钮 我尝试使用: -(void)subscribe:(id)sender { NSString* str = [NSString stringWithFormat:@"%@%@",@"http://www.youtube.com/subscription_center?add_user=",YouTubeUserName]; [[UIApplication sharedApplication]
-(void)subscribe:(id)sender
{
NSString* str = [NSString stringWithFormat:@"%@%@",@"http://www.youtube.com/subscription_center?add_user=",YouTubeUserName];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}
但这显示了一个Youtube屏幕,在那里我有一个登录/登录按钮。按login键时,会出现404页未找到错误
有什么建议吗
谢谢我建议使用来完成此任务。因为您需要事先对用户进行身份验证,所以它更为复杂,但这是一种更彻底、更无缝的方法。好的,但是我该如何使用订阅API?有没有代码示例?谷歌的应该可以帮助您入门。它与使用任何xml Web服务SOAP非常相似。已经看到了,但是没有订阅示例。我说的是iphone api,你需要模仿已经存在的调用,只需插入订阅方法。存在一个示例YouTube客户端。我还没有看到一个已经制作好的Objective-C订阅示例,所以您必须从这里开始。这是有效的:-voidsubscribe:idsender{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]];}