DZNPhotoPickerController icon indicating copy to clipboard operation
DZNPhotoPickerController copied to clipboard

Can anybody get google image search to work with new update?

Open krazeeKoder opened this issue 9 years ago • 11 comments
trafficstars

Keep getting Error 400 when using my web API key that was working with same code with previous pod version. When I try to use iOS key with bundle identifier that matches my app I get error 403. This http://stackoverflow.com/questions/24212412/google-custom-search-403-error-in-ios indicates that we should be sending our bundle identifier in the header but there is no method with field to enter bundle ID.

krazeeKoder avatar Apr 06 '16 21:04 krazeeKoder

can you please confirm if I should be using an iOS api key or if I should be using a browser key? The example project seems to work with a browser api key but not with an iOS api key. If it's the case that it's configured to work only with a browse api key than I would like to propose a feature request that allows you to also send your bundle identifier in the GET header which allows you to use the correct key which is the api Key. Thank you.

krazeeKoder avatar Apr 08 '16 19:04 krazeeKoder

Google Images used to work on the sample project. I just tried it again, and it doesn't anymore. Getting a 400 error code. Google Images APIs must have changed, once more. I don't have much time to look at this. If this is a requirement for your project, try fixing the issue and submit a PR.

dzenbot avatar Apr 14 '16 05:04 dzenbot

I'll take a look and see what I find... it's not the API that changed though because it was working with that API pre DZNPhotoPickerController update. Thanks either way :)

krazeeKoder avatar Apr 14 '16 20:04 krazeeKoder

I did a little digging and the URL seems correctly formatted. I am actually seeing problems with google own API explorer when I enter values for anything beyond cx, key, query, and searchType.

ebalassanian avatar Apr 26 '16 07:04 ebalassanian

I found two issues: use "start" instead of "page" and use initial value of 1 instead of 0. Also, you can only ask for 10 images at a time. To retrieve more, you have to do multiple queries which count against your query total.

ebalassanian avatar May 02 '16 20:05 ebalassanian

Yes, the limit is 10. We should add that to the documentation in https://github.com/dzenbot/DZNPhotoPickerController/blob/de2383ff5b9441c3bd4c0c256c388951e5982042/Examples/PhotoPicker/PhotoPicker/Private.h#L28-L28 You cannot paginate them either, so next page at index 2, will returns the exact same 10 images from the previous page. Google Images APIs are now incredibly useless without a subscription.

dzenbot avatar May 02 '16 21:05 dzenbot

So you managed to fix it? Mind submitting a PR @ebalassanian?

dzenbot avatar May 02 '16 21:05 dzenbot

I'm still trying to wrestle it to behaving. But yes, when I get it cleaned up I'll submit a PR... Bing is all kinds of messed up too. I never get MSFT. They are still using MS WORD for their documentation. Ewww!

ebalassanian avatar May 02 '16 21:05 ebalassanian

Yeah, both of those services are broken: hard to use, requiring complicated auth and old documentation. No wonder why people use less and less these sort of integrations.

dzenbot avatar May 02 '16 21:05 dzenbot

I submitted the fixes for Google. Let me know if you have any issues and I can address them. I was a bit selfish in the coding to make this work for my purposes, but given how clunky these services are, I"m guessing any changes are going to be short lived regardless.

ebalassanian avatar May 03 '16 18:05 ebalassanian

hold tight.. i had a merge issue. fixing now.

ebalassanian avatar May 03 '16 19:05 ebalassanian