Rahul Chidgopkar
Posts: 0
Joined: Tue May 14, 2013 7:11 am

Building a geolocation photo app with push notification

Hi,

I've started with Appery only a few days back and I find it very useful. But there are a few things missing in tutorials and I'm not able to find what I'm looking for in past questions, so I'm posting this. If you can direct me to the right resources or add a relevant tutorial/guide, it'll be great. I'm not a coder, so please keep it as simple as possible.

I'm building a proof of concept wherein User can take a photo and upload it to the database with geolocation. As soon as the photo is uploaded, I want to send a push notification to another user. I prefer using Parse.com for a backend.

The Handle Push Notifications from the app in the http://docs.appery.io/tutorials/sendi... tutorial does not give step-by-step instructions for configuring the different Services.

I have already posted the question regarding photo upload on this thread - https://getsatisfaction.com/apperyio/... but haven't got detailed instructions.

Please help me build this POC.

Thanks

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

Building a geolocation photo app with push notification

Hi Rahul,

Find how to add photos to database here:
https://getsatisfaction.com/apperyio/...

To add a geo-position you would need to create a new service and one column in the collection:
http://docs.appery.io/tutorials/build...

Connecting Parse.com to Appery would need a separate service research and developing.

Rahul Chidgopkar
Posts: 0
Joined: Tue May 14, 2013 7:11 am

Building a geolocation photo app with push notification

I was able to add photo to database, but I'm struggling to add the location with it.

I have created a geolocation service as shown here http://prntscr.com/155njz
I'm copying the geolocation data in service response into 2 local variables latitude and longitude as shown here http://prntscr.com/155no9
I've created a Create service for my database called uploadPhotoService where I'm trying to upload the geocoordinates. However, I have two local variables and only one request parameter. I'm not able to do the mapping. http://prntscr.com/155o8m

I checked again. There is no tutorial explaining how to upload geolocation to database. Please explain. Thanks.

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

Building a geolocation photo app with push notification

Add the following JavaScript to request for field with location:
codereturn [localStorage.getItem("long") 22, localStorage.getItem("lat") 22];/code
Returned value will be sent to the request field.
22 is for a reassurance there is a value.

Rahul Chidgopkar
Posts: 0
Joined: Tue May 14, 2013 7:11 am

Building a geolocation photo app with push notification

Thanks a lot. That was really useful.

I'm going to ask another silly question but I've tried a bunch of things and am still struggling. I have got a query service which returns data in the format shown here http://prntscr.com/157qnp

Now, I want to map the geolocation data to local variables so that I can display it on a google map. But the returned value is an array and I don't know how to extract longitude and latitude from it. I have done some incorrect mapping like this http://prntscr.com/157r2w

I apologize for my poor Javascript knowledge in advance. It'll also be great if you can show me the next step of mapping local lat and long variables on a google map.

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

Building a geolocation photo app with push notification

Hello! You can add JS in mapping to save into localStorage coordinates as JSON string. For example
codereturn JSON.stringify(value);/code
if you need to read it use this JS:
codevar photoCoordinates = JSON.parse(localStorage.getItem('photoCoordinates'));/code
in photoCoordinates will be an array with values
photoCoordinates[0] - first coordinate
photoCoordinates[1] - second coordinate.

Return to “Issues”