Saturday 17 October 2009

Tesco Finder's Town/City Search Not Working

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.

7 comments:

  1. Hey Nick,
    http://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

    ReplyDelete
  2. How about using an f***ing paid for service - are you not the mighty Tesco?

    ReplyDelete
  3. Hi Jamie

    Yes 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

    ReplyDelete
  4. Do you know about the OSM NameFinder already? http://gazetteer.openstreetmap.org/namefinder/?find=Hendon (and http://wiki.openstreetmap.org/index.php/Name_finder)

    ReplyDelete
  5. How about using CloudMade, which uses OpenStreetMap data (and is a bit faster than the namefinder). http://developers.cloudmade.com/projects/show/geocoding-http-api

    ReplyDelete
  6. Hey Nick - you might want to have a look at OpenStreetBrowser too.

    ReplyDelete
  7. Thanks for all these ideas - I've even been contacted by Microsoft to use their service, too!

    I will try as many backup geo services as I can.

    Cheers
    Nick

    ReplyDelete

As this blog grows in readership - and because it carries the Tesco brand - I have had to become more careful about the sort of comments that are acceptable. The good news is that I'm a champion of free speech so please be as praising or as critical as you wish! The only comments I DON'T allow through are:

1. Comments which criticise an individual other than myself, or are critical of an organisation other than Tesco. This is simply because they cannot defend themselves so is unfair and possibly libellous. Comments about some aspect of Tesco being better/worse than another equivalent organisation are allowed as long as you start by saying "in my personal opinion.." or "I think that...". ... followed by a "...because.." and some reasoned argument.

2. Comments which are totally unrelated to the context of the original article. If I have written about a mobile app and you start complaining about the price of potatoes then your comment isn't going stay for long!

3. Advertising / web links / spam.

4. Insulting / obscene messages.


Ok, rules done - now it's your go: