Skip to content

How to implement GTMAppAuth for youtube video upload #96

@georgek1991

Description

@georgek1991

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions