Skip to content

zeroasterisk/meteor-cordova-geolocation-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Meteor Cordova Geolocation Example

This is an Example Meteor Application using and demonstrating the following packages:

It utilizes

And the Cordova Plugins

What to Note:

  • See the client config in app.js
  • See the client start/stop in app.js
  • See the server REST API endpoint in route.js

How to Run Yourself: Locally

NOTE: this example uses Meteor + Cordova, which downloads a LOT of extra stuff. You may first want to familiarize yourself with Meteor Cordova Inetration (wiki) from the Meteor project wiki.

git clone https://github.com/zeroasterisk/meteor-cordova-geolocation-example.git
cd meteor-cordova-geolocation-example
meteor update
meteor run android-device -p 192.168.0.25:3000

(change the IP address to whatever your development machine's IP is, you can also try with ios)

How to Run on Device, against the example instance

Or on your own subdomain:

meteor run android-device --mobile-server geolocationbackgroundexample.meteor.com --verbose

Or on your own subdomain:

meteor deploy <mysub>.meteor.com
meteor run android-device --mobile-server <mysub>.meteor.com --verbose

Testing the REST(ish) handling

At the bottom of app.js you configure the URL to which we post the REST for background Geolocation data.

You can test this with curl, you don't even have to fire up Cordova.

curl -v -H "Content-Type: application/json" -X PUT --data '{"device":"curl","location":{"longitude":"-85.70906639098872","recorded_at":"Thu Sep 25 01:07:35 EDT 2014","latitude":"38.258042335509145","speed":"0.0","accuracy":"181.94342"},"uuid":"curl","userId":null}' 'http://localhost:3000/api/geolocation'

Releases

No releases published

Packages

No packages published