I'm trying to geolocate users in a Spotify app. However, I only get back garbage location data from Spotify. The promise doesn't fail, but return an accuracy of -1 and lat/lon of 200/200. Is there some permission that I'm missing? Has anyone successfully integrated this?
The code:
require([
'$api/models',
'$api/location',
'$views/image#Image',
'$views/list#List'
], function(models, Location, Image, List) {
'use strict';
var loc = Location.Location.query();
loc.load('latitude', 'longitude', 'accuracy').done(function() {
console.log('Found you!', loc.latitude, loc.longitude);
window.theLocation = loc;
}).fail(function(loc, error) {
console.log("I failed!", error)
});
...
The console:
Found you! 200 200
theLocation.accuracy
-1
theLocation.latitude
200
theLocation.longitude
200
EDIT: See my follow-up question here: What method(s) can I use for geolocation through a Spotify app?