错误域= com.google.GTMOAuth2代码= -1001 youtube api v3(iphone)

时间:2013-10-29 02:23:03

标签: ios iphone youtube

我想使用youtube v3 api for iphone,我有这个错误“Error Domain = com.google.GTMOAuth2 Code = -1001” 我的代码:

-(void)load{
NSString *clientID = kClientIDKey;
NSString *clientSecret = kClientSecretKey;

  GTMOAuth2Authentication *auth = nil;

if (clientID && clientSecret) {
   auth = [GTMOAuth2ViewControllerTouch  authForGoogleFromKeychainForName:kKeychainItemName
                                                             clientID:clientID
                                                            clientSecret:clientSecret];

}
if (auth.canAuthorize) {
    // Select the Google service segment
   // self.serviceSegments.selectedSegmentIndex = 0;

}
mAuth = auth;

GTLServiceYouTube* youtubeService = nil;
GTLQueryYouTube* videoQuery =nil;
//youtubeService type is GTLServiceYouTube
youtubeService = [[GTLServiceYouTube alloc] init];
youtubeService.shouldFetchNextPages = YES;

//auth is the object from the authentication callback

youtubeService.authorizer = mAuth;
videoQuery = [GTLQueryYouTube queryForSearchListWithPart:@"id"];
videoQuery.maxResults = 1;
videoQuery.q = @"Ndhblue8x";
GTLServiceTicket* youtubeTicket = [youtubeService executeQuery:videoQuery
                                             completionHandler:^(GTLServiceTicket *ticket, GTLYouTubeChannel *channel,
                                                                 NSError *error) {
                                                 NSLog(@" %@ ", error.description);
                                                 NSLog(@"WIN! : %@ ", channel.description);
                                             }];

}

我不明白为什么。请帮我决定是假的!

0 个答案:

没有答案