Page Summary
-
Users with Google accounts but without YouTube channels may encounter errors when performing actions requiring a YouTube channel.
-
Developers should implement a process to handle the
youtubeSignupRequirederror by directing users to create a channel. -
This process involves launching a WebView or similar object to a specific YouTube URL for channel creation.
-
Applications should monitor the WebView for a specific URL indicating channel creation completion before resending the initial API request.
-
If the user abandons channel creation, the application should inform them about the requirement to complete the action.
This document explains the process of spawning an Android WebView, iOS
UIWebView, or similar object, to allow a user to create a YouTube channel and
then return control to your application. Your application should implement this
flow to handle API errors that occur when a user with an unlinked Google Account
tries to complete an action that actually requires a YouTube channel.
Use case
The following steps explain the use case:
A user with an unlinked Google Account tries to complete an action that requires a YouTube channel. Your application sends an authorized API request for that action.
YouTube returns a
youtubeSignupRequirederror, indicating that the user must sign up for a YouTube account to complete the requested action.Your application launches a
WebViewor equivalent that loads the following URL:https://m.youtube.com/create_channel?chromeless=1&next=/channel_creation_doneThis page enables the user to log in and create a YouTube channel.
Your application monitors the
WebViewto determine when its location changes to the following URL, which indicates that the user's Google Account has been linked to a YouTube channel.https://m.youtube.com/channel_creation_doneYour application closes the
WebViewand resends the authorized API request from step 1.
Additional resources
The following resources may help you to implement this flow in your application:
Android developers
WebViewclass documentation- Building Web Apps in WebView
iOS developers
- Google Toolbox for Mac - OAuth 2.0
controllers – This project
demonstrates how to launch an OAuth 2.0 authorization flow in a
UIWebView, which is a similar operation to the one described in this document.
- Google Toolbox for Mac - OAuth 2.0
controllers – This project
demonstrates how to launch an OAuth 2.0 authorization flow in a