ios - Google API (YouTube search): Bad network response -


i'm getting following error while fetching videos keywords youtube ios application:

error domain=jsonmodelerrordomain code=2 "bad network response. json url unreachable." userinfo=0x79d86730 {nslocalizeddescription=bad network response. json url unreachable.

here code:

nsstring* searchcall = [nsstring stringwithformat:@"https://www.googleapis.com/youtube/v3/search?part=snippet&q=cats&type=video&videocaption=closedcaption&key=aizasydmq5tm_njrpnudomcnnwjdg8littyzbdm"];  [jsonhttpclient getjsonfromurlwithstring: searchcall                               completion:^(nsdictionary *json, jsonmodelerror *err) {                                   nslog(@"%@", err);                               }]; 

please me in resolving issue.

share|improve question

there problem api key, update , work:

"message": "there per-ip or per-referer restriction configured on api key , request not match these restrictions. please use google developers console update api key configuration if request ip or referer should allowed.",

share|improve answer
    
ok, i've recreate key: aizasydyg-vpa6t3xdx9gljmnvmdhof4otek_jq, error message not changed (bad network response). p.s. think saw error message in browser (not in ios application), note api_key generated ios apps. – slavik jun 15 '15 @ 6:54

ok, i've resolved problem removing bundleids can use api key ("google developer console" -> "apis & auth" -> "credentials" -> button "edit allowed ios applications"), after i've see line "ios applications: application allowed".

share|improve answer

your answer

 
discard

posting answer, agree privacy policy , terms of service.

not answer you're looking for? browse other questions tagged or ask own question.

Comments