Nick
Posts: 0
Joined: Wed Jul 24, 2013 7:28 am

Can i use the code as a web app?

Hello,
I am using appery platform to develop a ios/android app.
Since i also need to host a web version of the app (in case a user opens the website with a mobile device), i find the export html/js/css feature very useful.

I then uploaded my files to a folder on the server, tested it with several browsers, which works fine, but when i use a mobile device, iPhone 4 and Samsung Galaxy s4, the geolocation service i am using doesn't work.
When i invoke the service (using a button for example) the device asks me if i want this website to access my location, i choose yes and i see the gps icon on the phone toolbar "working", but the service fails.

Do you know why this is happening?
Is there any fix available for this problem?
thank you in advance.

Nick
Posts: 0
Joined: Wed Jul 24, 2013 7:28 am

Can i use the code as a web app?

By the way, when i open the app that is hosted on your servers from a mobile browser everything works fine...

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Can i use the code as a web app?

Hello! Could you give us URL you open on iPhone 4 and Samsung Galaxy s4 and tell how to reproduce the problem?

Nick
Posts: 0
Joined: Wed Jul 24, 2013 7:28 am

Can i use the code as a web app?

Sure,
The testing url is
http://m.peerpager.com/test.html
on your servers
http://appery.io/app/view/9a04f8dc-c8...

If you press the refresh button on the header, the geolocation service is being invoked.
If the service is successful it calls a rest remote service for reverse geolocation and puts the results on the 2 fields.

While on desktop browsers it works fine, when i test the page from mobile browsers the geolocation doesn't work (i added a "failed" alert on service fail).

Thank you for your immediate response

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Can i use the code as a web app?

Thanks! We'll take a look.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Can i use the code as a web app?

Hi Nick,

You output "response" variable that is undefined. You can use "data" variable instead. For example: codealert(data.coords.latitude);/code

Nick
Posts: 0
Joined: Wed Jul 24, 2013 7:28 am

Can i use the code as a web app?

Well that wasn't really the problem.
I fixed it anyway and still i get fail on phone and success on desktop browsers.
please test it here
http://appery.io/app/view/9a04f8dc-c8...

(i didn't update the webapp hosted on my server).

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Can i use the code as a web app?

Hi Nick,

We've tested on iPhone 5, it works. Please try to upload it on server.
What device did you try?

Nick
Posts: 0
Joined: Wed Jul 24, 2013 7:28 am

Can i use the code as a web app?

iPhone 4 and Samsung galaxy s4.
It seems to work after some 2 or 3 tries.
Should i add an event on geolocation fail to invoke geolocation again?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Can i use the code as a web app?

Hi Nick,

Yes, add the event handler with the following code:
codealert(JSON.stringify(arguments));/code
You can't always manage to quickly determine the exact coordinates, while access to the approximate location may be prohibited by device settings.

Return to “Issues”