Reputation: 4360
I have just downloaded the Google API objective C client. I opened the YouTube example project in Xcode on my Mac. It builds and runs without errors.
I registered a project with Google APIs, and created a Client ID for installed applications, choosing iOS and entering the sample code's Bundle ID, com.example.YouTubeSample. I left the App Store ID blank and deep linking disabled.
I entered the resulting Client ID and Client secrets into the sample app. I signed myself into Google through the app's window too, and it tells me I am signed in.
I then uploaded a 85kb .mov file. When it finished, it gave me the error:
Error Domain=com.google.GTLJSONRPCErrorDomain Code=-32602
"The operation couldn’t be completed. (Unauthorized)" UserInfo=0x...
{error=Unauthorized, NSLocalizedFailureReason=(Unauthorized),
GTLStructuredError=GTLErrorObject 0x...:
{message:"Unauthorized" data:[1] code:-32602}}
(Since the sample app is for Mac OS, not iOS, I also tried creating a second Client ID in Google APIs, for an installed application of type "other". I entered this new ID and secret into the sample app, and when I uploaded the .mov file I got the same error.)
Over in the API console, I see an error report showing 5 Error code 400s and 2 error code 500s.
What have I done wrong?
thanks!
Upvotes: 2
Views: 1327
Reputation: 4360
OK, the reason for this error was very simple. My google account did not have a YouTube channel associated with it.
However, with that fixed I am now getting a different error message (code -32602, "bad request"). I will post a new question for that.
Upvotes: 1