Possible bug in library (GTLYoutubeChannel)

13 views
Skip to first unread message

Leszek Niedziela

unread,
Feb 27, 2013, 4:53:32 PM2/27/13
to gdata-objec...@googlegroups.com
Hi all,
I am banging my head for many hours in a row and it looks like I am stuck with possible bug: I need to get subscribed channel id (channelId) from API response, but logging it to the console shows that channelId param has a question mark in it. See: GTLYouTubeChannel 0x1d550310: {kind:"youtube#channel" channelId?:"UCjOl2AUblVmg2rA_cRgZkFg"}.

I thought that I can reach a channelId in that way:

for (GTLYouTubeSubscription * ch in [channelList items]) {

//this is my channelId -> ch.snippet.resourceId.channelId

}


But this gives me an error. ch.snippet.resuceId should have a class GTLYouTubeResourceId, but XCode tells me that in fact this is an object of class GTLYouTubeChannel.

It looks like bug for me. What do you think?


Any ideas?


Les

Greg Robbins

unread,
Feb 27, 2013, 5:44:50 PM2/27/13
to gdata-objec...@googlegroups.com
The description of a GTLObject is just a summary of the JSON underlying the object. In this case, it may include a question mark suffix on keys that are not defined as properties in the generated interfaces. Look at the description method of GTLObject to see where the question mark is added.

To see the actual JSON dictionary underlying a GTLObject, print [object JSON] or [object JSONString]. It's also often useful to turn on the library's http logging feature to see the actual request and response.

I expect the query obtaining this channel list has the wrong part list parameter specified to retrieve the data that your app needs, though I am not very familiar with the YouTube API. For specific questions on use of the YouTube API, try the Get Help section at https://developers.google.com/youtube/v3/

Incidentally, this mailing list is for the older XML-based GData Objective-C library. The proper discussion group for issues related to the Objective-C library for JSON APIs is http://groups.google.com/group/google-api-objectivec-client

Reply all
Reply to author
Forward
0 new messages