Page 1 of 1

Can i use the code as a web app?

Posted: Wed Sep 18, 2013 1:16 pm
by Nick

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.


Can i use the code as a web app?

Posted: Wed Sep 18, 2013 1:48 pm
by Nick

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


Can i use the code as a web app?

Posted: Wed Sep 18, 2013 2:16 pm
by Maryna Brodina

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


Can i use the code as a web app?

Posted: Wed Sep 18, 2013 2:44 pm
by Nick

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


Can i use the code as a web app?

Posted: Wed Sep 18, 2013 4:01 pm
by Maryna Brodina

Thanks! We'll take a look.


Can i use the code as a web app?

Posted: Thu Sep 19, 2013 5:59 am
by Kateryna Grynko

Hi Nick,

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


Can i use the code as a web app?

Posted: Thu Sep 19, 2013 7:08 am
by Nick

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).


Can i use the code as a web app?

Posted: Thu Sep 19, 2013 8:08 am
by Kateryna Grynko

Hi Nick,

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


Can i use the code as a web app?

Posted: Thu Sep 19, 2013 8:53 am
by Nick

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?


Can i use the code as a web app?

Posted: Thu Sep 19, 2013 1:26 pm
by Kateryna Grynko

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.