error 1002 on iPhone

7 views
Skip to first unread message

Joachim Neumann

unread,
Feb 11, 2009, 8:21:39 AM2/11/09
to Loki API
Hi,

I have created a small web page that shows me my location. On my
computer, the page nicely and correctly shows my location in both
Safari and Firefox.

On my iPhone, I receive error 1002.

I guess that you are not supporting mobile Safari at the moment. Is
that correct and if yes, do you have plans to do so in the future?

Below, you find the source of my page:

Thanks - Joachim

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width = 320, user-scalable = no" />
<title>Loki Javascript API</title>
<script type="text/javascript" src="http://loki.com/plugin/files/
loki.js"></script>
<script type="text/javascript">
function load() {
var loki = LokiAPI();
loki.onSuccess = function(location) {
document.getElementById('estimatedLocation').innerHTML
= location.latitude+', '+location.longitude;
};
loki.onFailure = function(error) {
document.getElementById("estimatedLocation").innerHTML
= "error: "+error;
};
loki.requestLocation(true,loki.NO_STREET_ADDRESS_LOOKUP);
loki.setKey( *** anonymized, replace with yours *** );
}
</script>
</head>
<body onLoad="load();">
<h4>Loki location</h4>
<div id="estimatedLocation">...loading locaction (takes some
seconds)</div>
</body>
</html>

Ryan Sarver

unread,
Feb 11, 2009, 10:33:15 AM2/11/09
to loki...@googlegroups.com
Joachim,

Unfortunately Mobile Safari doesn't support plugins like Loki, hence
the error you are seeing.

Best, Ryan

Joachim Neumann

unread,
Feb 12, 2009, 1:24:41 PM2/12/09
to Loki API
Hi Ryan,

I understand your answer; it's Apple's fault, since they do not allow
plugins for Mobile Safari. However, I have a follow-up question
regarding the IP based function loki.requestIPLocation(). On the PC,
it returns the correct country. However, on the iPhone, I see error
1002 again. I am speculating that the functionality behind
requestIPLocation is implemented within your plugin.

My question is if it your be possible to take the IP based
localization out of the plugin and thus allow iPhone developpers to
use this fall-back solution. This might be possible, because the
function is not using any "local" features of the phone.

Thanks for listening and greetings from Barcelona - Joachim

Ryan Sarver

unread,
Feb 12, 2009, 1:52:54 PM2/12/09
to loki...@googlegroups.com
Joachim,

We currently are unable to make the IP service available outside of
the plugin. There are, however, a number of free options out there
including one from MaxMind.

However, be careful when using IP on mobile networks as the IPs will
typically all be coming from the same location if they are connected
over the mobile network as opposed to WiFi.

Best, Ryan

Joachim Neumann

unread,
Feb 12, 2009, 2:11:41 PM2/12/09
to Loki API
Hi Ryan,

Thanks for your fast answer. Yes, IP based location sucks.
However, things seem to improve fast. I'll be patient.

Joachim
Reply all
Reply to author
Forward
0 new messages