Titanium JIRA Archive
Appcelerator Community (AC)

[AC-997] Location services doesn't always work

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionNot Our Bug
Resolution Date2015-09-29T01:52:23.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAlloy
Labelsn/a
ReporterSamie Syed
AssigneeShak Hossain
Created2015-02-08T12:34:06.000+0000
Updated2016-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.

Comments

  1. Shuo Liang 2015-02-09

    Hi, Please provide a simple test case to reproduce your problem. That will be real helpful to address the problem. Thanks Regards, Shuo
  2. Samie Syed 2015-02-15

    Done
  3. Samie Syed 2015-02-15

    See edit.
  4. Shuo Liang 2015-02-16

    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]
  5. Samie Syed 2015-02-16

    changed it.
  6. Samie Syed 2015-02-16

    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.
  7. Motiur Rahman 2015-09-08

    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.

JSON Source