GTMAppAuth icon indicating copy to clipboard operation
GTMAppAuth copied to clipboard

How to implement GTMAppAuth for youtube video upload

Open georgek1991 opened this issue 5 years ago • 0 comments

I am planning to move from GTMOAuth2 to GTMAppAuth.

In my iOS app I allow user to upload a video to youtube channel which I have already set from backend, that means user do not need to login in to their youtube account to upload the video, they can simply choose to upload the video and the video will be uploaded to my channel.

With GTMOAuth2 it was simple I was using the below code:

GTLRYouTubeService *youtubeService = [[GTLRYouTubeService alloc] init];
GTMOAuth2Authentication *auth;
auth = [[GTMOAuth2Authentication alloc] init];
auth.accessToken = accessToken;
auth.refreshToken = refreshToken;
auth.clientID = clientID;
auth.clientSecret = clientSecret;
auth.shouldAuthorizeAllRequests = YES;
youtubeService.authorizer = auth;

[youtubeService executeQuery:<query goes here> completionHandler:^(GTLRServiceTicket *ticket, GTLRYouTube_Video *insertedVideo, NSError *error) {
    //youtube video upload completion
}];

Now I want to achieve this same behaviour with GTMAppAuth.

Is it possible to upload a video with GTMAppAuth to a particular youtube channel without user needing to login to their account? If yes how to go about it?

georgek1991 avatar Mar 05 '20 14:03 georgek1991