react-native/Libraries
Jason Gaare f7043699b0 Use Apple's significant-change API (for iOS 11 UX)
Summary:
In the yet-to-be-released iOS 11, Apple has changed the way they notify the user of location services. (You can watch their session from WWDC about all the changes [here](https://developer.apple.com/videos/play/wwdc2017/713/).)

The current implementation of `RCTLocationObserver` uses the standard location services from Apple. When the user has granted `Always` location permission and the application uses the background location service, the user is presented with the *_Blue Bar of Shame_* (for more information check out [this blog post](https://blog.set.gl/ios-11-location-permissions-and-avoiding-the-blue-bar-of-shame-1cee6cd93bbe)):

![image](https://user-images.githubusercontent.com/15896334/28285133-281e425c-6af9-11e7-9177-61b879ab593c.png)

* Added `useSignificantChanges` boolean to the options passed.

* Added `_usingSignificantChanges` boolean based on user options. If `true`, then the CLLocationManager will use functions `startMonitoringSignificantLocationChanges`/ `stopMonitoringSignificantLocationChanges` rather than the standard location services.
* Changed method signature of `beginLocationUpdatesWithDesiredAccuracy` to include `useSignificantChanges` flag
* Added check for new `NSLocationAlwaysAndWhenInUseUsageDescription`

All unit tests passed.

Tested in simulator and on device, toggling `useSignificantChanges` option when calling `watchPosition`. Results were as expected. **When `TRUE`, the _Blue Bar of Shame_ was not present.**

Changes do not affect Android and location services still work as expected on Android.

* Change is for iOS only
* Using a different API will have different accuracy results. Adding `useSignificantChanges` as an option was by design so apps that want to have most accurate and most frequent update can still use standard location services.
Closes https://github.com/facebook/react-native/pull/15062

Differential Revision: D5443331

Pulled By: javache

fbshipit-source-id: 0cf5b6cd831c5a7c8c25a5ddc2e410a9aa989bf4
2017-07-24 11:23:10 -07:00
..
ART Avoid creating a new Path instance for performance 2017-07-11 11:18:56 -07:00
ActionSheetIOS Enable -Wimplicit-retain-self en sync warning config for all projects 2017-03-23 15:01:34 -07:00
AdSupport Update AdSupportIOS.js 2017-04-28 06:34:21 -07:00
Alert Export Alert's type ButtonsArray for external use 2017-03-06 12:44:47 -08:00
Animated Native Animated - Override __makeNative in AnimatedInterpolation 2017-07-18 18:02:22 -07:00
AppState Added stubs for some native modules 2017-06-01 08:31:19 -07:00
BatchedBridge Revert D5446953: [react-native] Conditionally export JSTimers 2017-07-19 13:06:02 -07:00
BugReporting Patch up for future React Sync 2017-02-08 14:50:43 -08:00
CameraRoll Adding video play duration for camera roll 2017-07-14 17:39:36 -07:00
Components Identify keyboardDismissMode platform-specific options 2017-07-24 11:23:10 -07:00
Core Inline requires in JSTimers 2017-07-24 07:20:34 -07:00
EventEmitter Breaking - make RCTDeviceEventEmitter warnings fatal 2017-07-24 03:47:59 -07:00
Experimental Support for preventing swipe left or swipe right 2017-07-07 20:03:20 -07:00
Geolocation Use Apple's significant-change API (for iOS 11 UX) 2017-07-24 11:23:10 -07:00
Image Pass actual loaded image size to load (iOS). 2017-07-20 03:05:11 -07:00
Inspector Use fixed point in inspector 2017-07-06 14:52:28 -07:00
Interaction Move jest to version 20 2017-06-14 12:48:22 -07:00
JSInspector Add Network agent 2016-11-02 12:29:15 -07:00
LayoutAnimation Fix prop-types warning in LayoutAnimation 2017-05-12 15:06:17 -07:00
Linking Add newly recommended method for RCTLinkingManager due to deprecation 2017-05-25 11:31:23 -07:00
LinkingIOS Add newly recommended method for RCTLinkingManager due to deprecation 2017-05-25 11:31:23 -07:00
Lists Improve the documentation for ListView and ListViewDataSource 2017-07-21 14:31:17 -07:00
Modal iOS `presentationStyle` Modal Appearance 2017-06-20 19:22:57 -07:00
NativeAnimation Stop native driver animations when value is set. 2017-07-20 14:20:30 -07:00
Network Removing @nolint from flow files 2017-07-12 14:09:54 -07:00
Performance Remove legacy JSC profiler 2017-07-20 04:21:16 -07:00
PermissionsAndroid Include Create React Native App in Getting Started 2017-04-26 07:16:18 -07:00
PushNotificationIOS Rename _remoteNotificationCompleteCalllbackCalled to _remoteNotificationCompleteCallbackCalled 2017-07-11 11:06:21 -07:00
RCTTest Replace exported method registration with statically allocated struct 2017-07-24 07:01:53 -07:00
ReactNative Support native ViewManager inheritance on iOS 2017-07-10 16:01:12 -07:00
Renderer React sync for revisions cb32253...5495e49 2017-07-13 17:38:57 -07:00
Sample Fix missing RCTBridgeModule.h 2017-01-31 11:13:50 -08:00
Settings Enable -Wimplicit-retain-self en sync warning config for all projects 2017-03-23 15:01:34 -07:00
Share Flowify Process Color 2017-04-26 11:31:56 -07:00
Storage correctly order ASyncStorage 2017-02-21 15:18:40 -08:00
StyleSheet Enable flow for TouchableHighlight 2017-07-12 04:15:41 -07:00
Text TextInput: Actual `reactAccessibilityElement` implementation 2017-07-19 17:21:02 -07:00
Utilities remove disableAutomock from jest tests (new default) @bypass-lint 2017-06-13 15:04:09 -07:00
Vibration Enable -Wimplicit-retain-self en sync warning config for all projects 2017-03-23 15:01:34 -07:00
WebSocket Make startup errors in the websocket executor invalidate the bridge 2017-06-22 08:37:13 -07:00
polyfills Remove default polyfills from metro-bundler 2017-07-17 03:20:02 -07:00
react-native MaskedViewIOS -- A way to apply alpha masks to views on iOS 2017-07-11 15:05:57 -07:00
vendor Make Set and Map initialization lazy 2017-07-24 07:20:33 -07:00
Promise.js Don't require prettyFormat in every single bundle. 2017-06-16 04:31:56 -07:00
promiseRejectionIsError.js RN: Cleanup OSS JS & Flow Declarations 2016-11-20 17:58:29 -08:00