[AC-1248] iOS 8 Location Services Incompatibility
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Not Our Bug |
Resolution Date | 2014-09-24T22:50:27.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | App, Geolocation, Location, LocationServices, Services, Settings, SettingsApp, Studio, TCSupportTriage, Ti.Geolocation, Titanium, TitaniumStudio3.4, iOS8 |
Reporter | June Rockwell |
Assignee | Mauro Parra-Miranda |
Created | 2014-09-24T00:35:36.000+0000 |
Updated | 2016-03-08T07:37:38.000+0000 |
Description
Using Titanium Studio 3.3.x, Ti.Geolocation worked flawlessly for iPhone 5S running iOS 7. But just today, I upgraded this iPhone 5S to iOS 8 and Ti.Geolocation can't getCurrentLocation. I turned on the Location Services in the iOS 8 Settings app but it doesn't save the setting configuration for my specific app. I would indicate "Always" for Location Services and switch back to my app. By the time I get to my app, the Location Services turns off automatically and I haven't even really pressed or swiped or did anything. And when I go back to the Settings app to check the location setting for my my app, the setting configuration wasn't saved at all and neither "Never" or "Always" were checked. This is this same with Titanium Studio 3.4.x
Attachments
File | Date | Size |
---|---|---|
Before_saving.jpg | 2014-09-24T00:35:36.000+0000 | 12799 |
didnt_save.jpg | 2014-09-24T00:35:36.000+0000 | 10660 |
Hello, [~jhrockwell] According to the Titanium Location service Documentation [iOS Development Considerations](http://docs.appcelerator.com/titanium/latest/#!/guide/Tracking_Position_and_Heading-section-29004915_TrackingPositionandHeading-iOSDevelopmentConsiderations) Starting with iOS 8, to use location services, you need to add either the NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription key to the iOS plist section of the project's tiapp.xml file.
CODE SEGMENT
I have tested the Titanium location service API in iOS 8.0 Device, with the above code section in tiapp.xml file. it's working fine. Once the location service is enabled in an app, it remains enabled. Thanks.
@Amimul Hossain thanks. The settings configuration in the Settings app now save. But when the user first installs the app, do they have to go to the iOS Settings App to save the configuration or by adding NSLocationAlwaysUsageDescription or NSLocationWhenInUseUsageDescription the settings should be automatically saved in the Settings App without the user having to set the configurations? Right now, after trying it, I have to go the Settings App and set the configuration. Is this ideal?
Hi [~jhrockwell], I have put together a little sample to test your issue. Please follow the instructions below.
Create a new app
Paste the example code below into your app.js
Add the code segment posted by [~ahossain] into your
tiapp.xml
Run the app
When the app launches, click the 'getCurrentPostion' button
You should see an alert dialog asking if you would like to allow the app access to your location... click 'Allow'.
You should now see a JSON string of your current position in the middle of the screen.
You can also test what will happen when you click 'Don't Allow' by deleting your app from your device and reinstalling the app. After doing this it will prompt you to allow again.
Keep an eye on your device log while testing this to see if there are any helpful log messages. Let me know how it goes.@Jon Alter, thanks! I forgot to update some things on the SDK. Your instructions helped a lot in me figuring out what I've missed.
[~jhrockwell]: Based on your last comment. Does this work for you now? Do you agree to close this issue?
Yes, it works now. The issue is resolved. Thank you all for your help!