I try to send request: POST https://www.googleapis.com/youtube/v3/liveStreams
Response failed with message:
"The request did not specify any iOS bundle ID. Please ensure that the client is sending it or use the API Console to update your key restrictions."
My OAuth 2.0 client ID (iOS) and API Key on the Google API Manager have right bundle iD. I send key=API_KEY.
How can I send my bundle id with the request? Or I have to do something else?
yogesh
POST Request:
NSURL * url = [NSURL URLWithString:@"https://www.googleapis.com/youtube/v3/liveStreams"];
NSMutableURLRequest * request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:url]];
/**
* set access token in HTTP Header field
* get access token after successful login
*/
[request setValue:[NSString stringWithFormat:@"Bearer %@",_str_access_token] forHTTPHeaderField:@"Authorization"];
/**
* set bundle identifier on Header field
*/
[request addValue:[[NSBundle mainBundle] bundleIdentifier] forHTTPHeaderField:@"X-Ios-Bundle-Identifier"];
来源:https://stackoverflow.com/questions/40043972/youtube-live-streaming-api-create-live-stream-is-failed-with-the-request-did