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.
Comentários