jbeuckm / TiBeacons

iBeacon advertising and scanning in a Titanium module
Other
135 stars 57 forks source link

"Location services not authorized" error #34

Open avines002 opened 9 years ago

avines002 commented 9 years ago

hello,

I must be missing something obvious. I'm trying to run the sample code to look for a beacon, but I just keep receiving the error Location services not authorized. shouldn't the user be prompted with an alert to authorize location services? Do i need to add something to my TiApp.xml file?

h3r2on commented 9 years ago

this is not in the docs as of yet that I'm aware but this will fix it for you.

Ti.Geolocation.requestAuthorization(Ti.Geolocation.AUTHORIZATION_ALWAYS);

where AUTHORIZATION_ALWAYS is whichever auth your app needs. I found it the hard way...

avines002 commented 9 years ago

This is working, thank you! is there some kind of callback that can be used to determine which option the user chose? Or at least catch the error to notify the user they need to turn it on or prompt again?

h3r2on commented 9 years ago

no this is a setting you set in your app see the docs: http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.Geolocation