[AC-997] Location services doesn't always work
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Not Our Bug |
Resolution Date | 2015-09-29T01:52:23.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Alloy |
Labels | n/a |
Reporter | Samie Syed |
Assignee | Shak Hossain |
Created | 2015-02-08T12:34:06.000+0000 |
Updated | 2016-03-08T07:37:19.000+0000 |
Description
Steps to replicate:
After modifying my TiAPP editor, and adding this to enable location services:
NSLocationAlwaysUsageDescription
App requires this to be enabled.
NSLocationWhenInUseUsageDescription
App requires this to be enabled.
I find that after running the app in a simulator for the first time a dialog box pops up, if i press "always allow" it works. However, if I close the simulator, then re run it, location services are not running for the app. I have to manually go to debug > location > select a location
This was working fine before.
Any idea why this is happening, thanks
Simple Test case:
1) create new alloy project
2)Modify tiapp.xml file
http://ti.appcelerator.org">
com.testLocationServices
testLocationServices
1.0
ss
http://
2015 by ss
appicon.png
false
false
true
eec6a952-5cf4-42e8-974d-36868fb64701
dp
UISupportedInterfaceOrientations~iphone
UIInterfaceOrientationPortrait
UISupportedInterfaceOrientations~ipad
UIInterfaceOrientationPortrait
UIInterfaceOrientationPortraitUpsideDown
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
UIRequiresPersistentWiFi
UIPrerenderedIcon
UIStatusBarHidden
UIStatusBarStyle
UIStatusBarStyleDefault
NSLocationUsageDescription
app requires this to be enabled.
NSLocationAlwaysUsageDescription
app requires this to be enabled.
NSLocationWhenInUseUsageDescription
app requires this to be enabled.
http://schemas.android.com/apk/res/android"/>
true
true
default
true
false
true
true
true
3.4.1.v20141001062512
ti.alloy
add the following lines into tiapp.xml to enable location services (as above)
NSLocationUsageDescription
app requires this to be enabled.
NSLocationAlwaysUsageDescription
app requires this to be enabled.
NSLocationWhenInUseUsageDescription
app requires this to be enabled.
Controller:
index.js
Titanium.Geolocation.addEventListener('location', function(e) {
if (e.error) {
alert(e.error);
} else {
Ti.API.info(e.coords);
}
});
Run in ioS 8.1 simulator iphone 6.
Compiled in SDK 3.4.1
You will get a authorisation dialog box when you first start the app, after accepting ok, location services are not turned on and the error alert fires.
Hi, Please provide a simple test case to reproduce your problem. That will be real helpful to address the problem. Thanks Regards, Shuo
Done
See edit.
The test case should include the following content, please review. Thanks. [http://docs.appcelerator.com/titanium/3.0/#!/guide/How_to_Submit_a_Bug_Report-section-29004732_HowtoSubmitaBugReport-CreatingaTestCase]
changed it.
Seems like someone else has experienced the same problem here: https://developer.appcelerator.com/question/178407/ios8-with-ti-340-sdk-getcurrentposition-error-the-operation-couldnt-be-completed And was unable to resolve it. Appcelerator can you help please, thanks.
Hello, It's not an issue. It's a default behavior of simulator or device if you don't allow anything to the App launch. Next time, you have to manually permission this otherwise it will not work. For doing that Settings>> APP_NAME>> Then enable permission. Thanks.