{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/6987","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/6987/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/6987/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/6987/events","html_url":"https://github.com/facebook/react-native/pull/6987","id":148553543,"number":6987,"title":"Fix distanceFilter caching for LocationObserver","user":{"login":"jrichardlai","id":159813,"avatar_url":"https://avatars.githubusercontent.com/u/159813?v=3","gravatar_id":"","url":"https://api.github.com/users/jrichardlai","html_url":"https://github.com/jrichardlai","followers_url":"https://api.github.com/users/jrichardlai/followers","following_url":"https://api.github.com/users/jrichardlai/following{/other_user}","gists_url":"https://api.github.com/users/jrichardlai/gists{/gist_id}","starred_url":"https://api.github.com/users/jrichardlai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrichardlai/subscriptions","organizations_url":"https://api.github.com/users/jrichardlai/orgs","repos_url":"https://api.github.com/users/jrichardlai/repos","events_url":"https://api.github.com/users/jrichardlai/events{/privacy}","received_events_url":"https://api.github.com/users/jrichardlai/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react-native/labels/CLA%20Signed","name":"CLA Signed","color":"e7e7e7"},{"url":"https://api.github.com/repos/facebook/react-native/labels/GH%20Review:%20review-needed","name":"GH Review: review-needed","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-04-15T04:42:03Z","updated_at":"2016-04-22T01:50:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/6987","html_url":"https://github.com/facebook/react-native/pull/6987","diff_url":"https://github.com/facebook/react-native/pull/6987.diff","patch_url":"https://github.com/facebook/react-native/pull/6987.patch"},"body":"Allow changing distanceFilter after _locationManager has been initialized.\r\n\r\nThere is 2 reasons for this PR:\r\n- When calling `getCurrentPosition`, `_observerOptions` is possibly not set properly ( as it is set only in `startObserving`), in this case it would have default values so `distanceFilter` will be 0 in this case ( which can be the right value but we should be more explicit about it, `kCLDistanceFilterNone` or `RCT_DEFAULT_LOCATION_ACCURACY`):\r\n<img width=\"961\" alt=\"screen shot 2016-04-14 at 8 44 09 pm\" src=\"https://cloud.githubusercontent.com/assets/159813/14551465/6aa8791a-0288-11e6-9c98-1687357f8c2a.png\">\r\n- Another issue is that `distanceFilter` is cached so it can't be changed afterwards:\r\n\r\n```javascript\r\nlet options;\r\noptions = {\r\n  enableHighAccuracy: true,\r\n  distanceFilter: 20,\r\n};\r\n\r\nthis.watchId = this.geolocation.watchPosition(\r\n  () => { },\r\n  () => { },\r\n  options,\r\n);\r\n\r\n// => sets distanceFilter to 20\r\n\r\nthis.geolocation.clearWatch(this.watchId);\r\n\r\noptions = {\r\n  enableHighAccuracy: false,\r\n  distanceFilter: 1000,\r\n};\r\n\r\nthis.watchId = this.geolocation.watchPosition(\r\n  () => { },\r\n  () => { },\r\n  options,\r\n);\r\n\r\n// => distanceFilter is still 20\r\n```"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/213207874","html_url":"https://github.com/facebook/react-native/pull/6987#issuecomment-213207874","issue_url":"https://api.github.com/repos/facebook/react-native/issues/6987","id":213207874,"user":{"login":"christopherdro","id":3741055,"avatar_url":"https://avatars.githubusercontent.com/u/3741055?v=3","gravatar_id":"","url":"https://api.github.com/users/christopherdro","html_url":"https://github.com/christopherdro","followers_url":"https://api.github.com/users/christopherdro/followers","following_url":"https://api.github.com/users/christopherdro/following{/other_user}","gists_url":"https://api.github.com/users/christopherdro/gists{/gist_id}","starred_url":"https://api.github.com/users/christopherdro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christopherdro/subscriptions","organizations_url":"https://api.github.com/users/christopherdro/orgs","repos_url":"https://api.github.com/users/christopherdro/repos","events_url":"https://api.github.com/users/christopherdro/events{/privacy}","received_events_url":"https://api.github.com/users/christopherdro/received_events","type":"User","site_admin":false},"created_at":"2016-04-22T01:50:54Z","updated_at":"2016-04-22T01:50:54Z","body":"@jrichardlai Looks great!\r\n\r\nI would suggest separating this into two different PR's since it's unlikely this will get merged if tests are failing.\r\n\r\nCan you update this PR to just include your changes to `RCTLocationObserver.m`? \r\nLet's see if we can get that to pass and get merged in?\r\n\r\nWe can then follow up with your tests.\r\n\r\nThanks again for the PR!\r\n\r\n"}}