{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/19057","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/19057/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/19057/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/19057/events","html_url":"https://github.com/facebook/react-native/issues/19057","id":318557315,"node_id":"MDU6SXNzdWUzMTg1NTczMTU=","number":19057,"title":"navigator.geolocation.getCurrentPosition stop working after we add NSLocationAlwaysUsageDescription and NSLocationWhenInUseUsageDescription to plist.","user":{"login":"sadeghipour","id":7029205,"node_id":"MDQ6VXNlcjcwMjkyMDU=","avatar_url":"https://avatars0.githubusercontent.com/u/7029205?v=4","gravatar_id":"","url":"https://api.github.com/users/sadeghipour","html_url":"https://github.com/sadeghipour","followers_url":"https://api.github.com/users/sadeghipour/followers","following_url":"https://api.github.com/users/sadeghipour/following{/other_user}","gists_url":"https://api.github.com/users/sadeghipour/gists{/gist_id}","starred_url":"https://api.github.com/users/sadeghipour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sadeghipour/subscriptions","organizations_url":"https://api.github.com/users/sadeghipour/orgs","repos_url":"https://api.github.com/users/sadeghipour/repos","events_url":"https://api.github.com/users/sadeghipour/events{/privacy}","received_events_url":"https://api.github.com/users/sadeghipour/received_events","type":"User","site_admin":false},"labels":[{"id":846765400,"node_id":"MDU6TGFiZWw4NDY3NjU0MDA=","url":"https://api.github.com/repos/facebook/react-native/labels/:rewind:Old%20Version","name":":rewind:Old Version","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-04-27T21:37:37Z","updated_at":"2018-06-04T06:49:40Z","closed_at":null,"author_association":"NONE","body":"<!--\r\n  We use GitHub Issues exclusively for tracking bugs in React Native.\r\n  Questions? Visit http://facebook.github.io/react-native/help.html\r\n  If this issue is about documentation or the website, please file it at:\r\n  https://github.com/facebook/react-native-website/issues/new\r\n-->\r\n\r\n- [x] I have reviewed the [documentation](https://facebook.github.io/react-native)\r\n- [x] I have searched [existing issues](https://github.com/facebook/react-native/issues)\r\n- [x] I am using the [latest React Native version](https://github.com/facebook/react-native/releases)\r\n\r\n<!-- Describe your issue in detail. -->\r\n\r\n## Environment\r\n<!-- Required. Run `react-native info` in your terminal and paste its contents here. -->\r\nEnvironment:\r\n  OS: macOS High Sierra 10.13.4\r\n  Node: 8.11.1\r\n  Yarn: 1.6.0\r\n  npm: Not Found\r\n  Watchman: 4.9.0\r\n  Xcode: Xcode 9.3 Build version 9E145\r\n  Android Studio: 3.0 AI-171.4443003\r\n\r\nPackages: (wanted => installed)\r\n  react: 16.2.0 => 16.2.0\r\n  react-native: 0.53.0 => 0.53.0\r\n## Steps to Reproduce\r\n<!-- \r\n  Required. Let us know how to reproduce the issue. Include a code sample, share a project, \r\n  or share an app that reproduces the issue using [Snack](https://snack.expo.io/).\r\n-->\r\n\r\n@tarikkurucu and me are developing an application with pure react-native (not with expo) and yesterday we deploy our new version of application to App Store in order to test in TestFlight. after application uploaded to store we received a letter from Apple that we must add 2 keys to our .plist file as below:\r\n\r\n> We identified one or more issues with a recent delivery for your app, \"***********\". Please correct the following issues, then upload again.\r\n> \r\n> Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSLocationAlwaysUsageDescription key with a string value explaining to the user how the app uses this data.\r\n> \r\n> Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSLocationWhenInUseUsageDescription key with a string value explaining to the user how the app uses this data.\r\n\r\n After we add keys to .plist file we figured out that **navigator.geolocation.getCurrentPosition**  stopped working.\r\n\r\nAfter searching in Internet we couldn't find any solution and finally we write our native module.\r\n\r\n## Expected Behavior\r\n<!-- Write what you thought would happen. -->\r\n\r\nnavigator.geolocation.getCurrentPosition must return user location after user allows to reach GPS. \r\n\r\n## Actual Behavior\r\n<!-- Write what happened. Include screenshots if needed. If this is a regression, let us know. -->\r\nnavigator.geolocation.getCurrentPosition not fire up after call.\r\n\r\nNativeLocationRequest.h:\r\n\r\n      #import <React/RCTBridgeModule.h>\r\n      @interface NativeLocationRequest : NSObject<RCTBridgeModule>\r\n       @end\r\n\r\nNativeLocationRequest.m:\r\n\r\n    #import \"NativeLocationRequest.h\"\r\n    #import <CoreLocation/CoreLocation.h>\r\n\r\n    @implementation NativeLocationRequest\r\n    RCT_EXPORT_MODULE();\r\n\r\n    CLLocationManager *locationManager;\r\n\r\n\r\n    RCT_EXPORT_METHOD(NativeLocationRequestStart)\r\n    {\r\n      \r\n      if ([CLLocationManager locationServicesEnabled]) {\r\n        \r\n        switch ([CLLocationManager authorizationStatus]) {\r\n          case kCLAuthorizationStatusDenied:\r\n            locationManager = [[CLLocationManager alloc] init];\r\n            locationManager.desiredAccuracy = kCLLocationAccuracyBest;\r\n            //[locationManager requestAlwaysAuthorization];\r\n            [locationManager requestWhenInUseAuthorization];\r\n            \r\n            break;\r\n          case kCLAuthorizationStatusRestricted:\r\n            \r\n            locationManager = [[CLLocationManager alloc] init];\r\n            locationManager.desiredAccuracy = kCLLocationAccuracyBest;\r\n            //[locationManager requestAlwaysAuthorization];\r\n            [locationManager requestWhenInUseAuthorization];\r\n            \r\n            break;\r\n          case kCLAuthorizationStatusAuthorizedAlways:\r\n            \r\n            break;\r\n          case kCLAuthorizationStatusAuthorizedWhenInUse:\r\n            \r\n            break;\r\n          case kCLAuthorizationStatusNotDetermined:\r\n            locationManager = [[CLLocationManager alloc] init];\r\n            locationManager.desiredAccuracy = kCLLocationAccuracyBest;\r\n            //[locationManager requestAlwaysAuthorization];\r\n            [locationManager requestWhenInUseAuthorization];\r\n            break;\r\n          default:\r\n            break;\r\n        }\r\n      } else {\r\n        locationManager = [[CLLocationManager alloc] init];\r\n        locationManager.desiredAccuracy = kCLLocationAccuracyBest;\r\n        //[locationManager requestAlwaysAuthorization];\r\n        [locationManager requestWhenInUseAuthorization];\r\n        \r\n      }\r\n      \r\n    }\r\n    @end\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/394251470","html_url":"https://github.com/facebook/react-native/issues/19057#issuecomment-394251470","issue_url":"https://api.github.com/repos/facebook/react-native/issues/19057","id":394251470,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDI1MTQ3MA==","user":{"login":"pavermakov","id":10779996,"node_id":"MDQ6VXNlcjEwNzc5OTk2","avatar_url":"https://avatars3.githubusercontent.com/u/10779996?v=4","gravatar_id":"","url":"https://api.github.com/users/pavermakov","html_url":"https://github.com/pavermakov","followers_url":"https://api.github.com/users/pavermakov/followers","following_url":"https://api.github.com/users/pavermakov/following{/other_user}","gists_url":"https://api.github.com/users/pavermakov/gists{/gist_id}","starred_url":"https://api.github.com/users/pavermakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavermakov/subscriptions","organizations_url":"https://api.github.com/users/pavermakov/orgs","repos_url":"https://api.github.com/users/pavermakov/repos","events_url":"https://api.github.com/users/pavermakov/events{/privacy}","received_events_url":"https://api.github.com/users/pavermakov/received_events","type":"User","site_admin":false},"created_at":"2018-06-04T06:49:40Z","updated_at":"2018-06-04T06:49:40Z","author_association":"NONE","body":"So, what's the final solution to the issue?"}}
{"actor":{"display_login":"pavermakov"}}