If you attempt to use Tesco Finder's "Town/City Search" function to locate a Tesco store manually, you'll find you get the message,
"I couldn't connect to Google.com. Please check your network connection or try again later.".
So what's happening? Basically we've programmed Tesco Finder to use Google's geo-search API, where we pass on the town or city name you typed in and get back the latitude and longitude of that place. We then use that data instead of iPhone's location to perform the Tesco store search.
It's been working wonderfully for the two months we've been testing the app. However, "wonderfully" ended on Tuesday just after it arrived in the App Store. Talk about timing! Google's geo-search API comes up with an 'error 610' every time we use it now, rather than the actual latitude and longitude.
Here is an example of what Tesco Finder sends:
..where a customer typed in 'hendon' into Tesco Finder.
Now all we get back is:
610,0,0,0
...when we want something like:
200,0,51.5878,-0.22911
...where those last two values are the latitude and longitude of Hendon in London.
In fact we're getting 610,0,0,0 for anything we type in.
So now I need to find a working (and free to use) API that will convert UK towns and cities into latitudes and longitudes as easily as this. I then need to issue an update to the Apple iTunes App Store with its usual 10-14 day delay before it goes live.
There's a lesson to learn here, and that is when you write applications of this sort, always make them talk only to your own servers and not directly to third party services. If I had done this, I would have simply scouted for a replacement API and adjusted our server's code to use that. The iPhone app would just use our server to ask for geo-coordinates every time, not caring about what the server had to do to get the data. The server could be coded to have backup geo-data suppliers in case one didn't work. Doing it this way makes you the master of your own destiny and not beholden to anyone else.
In trusting the third party service I was trying to be clever. Fail.
I need to get out of the web mindset where you actually only have one application - your web application. We have thousands of Tesco Finder applications out there, so now I have a new rule: The only place our apps will 'phone' from now on, is home.
UPDATE
----------
I'm not the only one suddenly getting this problem -
Google Forum thread on it here - it seems they have updated their code after the weekend to require a licence key - only serving to highlight that this would have been an easy fix if only I had coded the app to look to our server.
Hey Nick,
ReplyDeletehttp://www.google.co.uk/maps/geo?q=hendon&output=csv works fine for me. it returns:
200,4,-28.0763150,151.9507570
I guess its intermittent huh!!!
Interesting learning point there though - I'll remember that for future.,
-Jamie
How about using an f***ing paid for service - are you not the mighty Tesco?
ReplyDeleteHi Jamie
ReplyDeleteYes I have had a couple of emails saying that Tesco Finder's Town/City Search is working fine for them too.
It seemingly depends on what Google thinks is the domain which the iPhone appears to be on - so it may not work on 3G but may work through your company's outbound Wifi internet facilty.
Proper fix in progress though!
---
6p00d8341c8bbb53ef, if we can use free services that welcome commercial use (such as Google's Maps API) then it's less of a drain on my small R&D budget. No drain at all in fact. And that enables us to keep our prices down.
Cheers
Nick
Do you know about the OSM NameFinder already? http://gazetteer.openstreetmap.org/namefinder/?find=Hendon (and http://wiki.openstreetmap.org/index.php/Name_finder)
ReplyDeleteHow about using CloudMade, which uses OpenStreetMap data (and is a bit faster than the namefinder). http://developers.cloudmade.com/projects/show/geocoding-http-api
ReplyDeleteHey Nick - you might want to have a look at OpenStreetBrowser too.
ReplyDeleteThanks for all these ideas - I've even been contacted by Microsoft to use their service, too!
ReplyDeleteI will try as many backup geo services as I can.
Cheers
Nick