Last active
September 8, 2016 19:31
-
-
Save thehungrycoder/ecab6e4b61565f76245871e7196c74cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('myapp.services', []) | |
.service('LocationService', function ($cordovaGeolocation) { | |
return { | |
askLocationPermission: function (successCallback, errorCallback) { | |
var permissions = cordova.plugins.permissions; // could not find a better way to access cordova; it's not in $window | |
permissions.requestPermission(permissions.ACCESS_COARSE_LOCATION, successCallback, errorCallback); | |
} | |
getCoords: function () { | |
// omitted for brevity | |
}; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment