Question

I have an application that uploads video files to youtube. The problem I have is that if a user that wants to upload a video file to youtube, has several channels on youtube, my login flow doesn't show a list in which the user can select the correct channel. For example this is what Google's app, Capture, shows when I login with an account which has two identities: select channel

When my app uses the same account I do not see a list of channels. This is the code I use to login to youtube:

NSString *scope = [GDataServiceGoogleYouTube authorizationScope];

SEL finishedSel = @selector(viewController:finishedWithAuth:error:);

GTMOAuth2ViewControllerTouch *viewController;
viewController = [GTMOAuth2ViewControllerTouch controllerWithScope:scope
                                                          clientID:g_clientID
                                                      clientSecret:g_clientSecret
                                                  keychainItemName:g_keychainItemName
                                                          delegate:self
                                                  finishedSelector:finishedSel];

UINavigationController *aNavController = [[UINavigationController alloc] initWithRootViewController:viewController];
[self presentModalViewController:aNavController animated:YES];
[aNavController release];

So what do I need to do to show this list of channels?

Was it helpful?

Solution

So I managed to fix the problem.

To see a list of a user's youtube channels, you must use the latest version of google's objective-c library at http://code.google.com/p/google-api-objectivec-client/.

Also when you are authorizing you must use kGTLAuthScopeYouTube authorization scope, like so:

GTMOAuth2ViewControllerTouch *viewController;
    viewController = [GTMOAuth2ViewControllerTouch controllerWithScope:kGTLAuthScopeYouTube
                                                              clientID:g_clientID
                                                          clientSecret:g_clientSecret
                                                      keychainItemName:g_keychainItemName
                                                              delegate:self
                                                      finishedSelector:finishedSel];

    UINavigationController *aNavController = [[UINavigationController alloc] initWithRootViewController:viewController];
    [self presentModalViewController:aNavController animated:YES];
    [aNavController release];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top