Reputation: 1210
I am integrating video upload to Youtube from iOS application.
Steps followed :
Case # 1
GTMOAuth2ViewControllerTouch : completionHandler:^(GTMOAuth2ViewControllerTouch *viewController, GTMOAuth2Authentication *auth, NSError *error)
{self.youTubeService.authorizer = auth;
}
Case #2
GTMOAuth2ViewControllerTouch : completionHandler:^(GTMOAuth2ViewControllerTouch *viewController, GTMOAuth2Authentication *auth, NSError *error)
{self.youTubeService.authorizer = auth;
}
Note : If i uses same account (used to create client ID and secret) to login and upload, it is working fine and video is displaying in Youtube. But whenever trying with other account to upload it causing problem even in Google API objective C client application too.
let me know if i missing any other cases to be consider to do so. thanks.
Upvotes: 0
Views: 1004
Reputation: 1210
After a day of search/testing, finally found the cause. There is nothing wrong with my OAuth process. The cause is other multiple accounts (not the one used to create Client ID and Client Secret) was not having a channel in Youtube.
Solution : If user account is new to Youtube, then youtube won't have a channel for that account. User need to create one (that's easy, Youtube itself will alert to create new channel when, My Channel from left side pane is get selected)
If user account have valid channel, then the above "Unauthorized" error won't be happen.
Upvotes: 0
Reputation: 12877
You may be doing Auth wrong, or the user may not have a valid connect YouTube channel. You can check YouTube Direct Lite for iOS project for the best example.
Upvotes: 0