v1.0.0
Changes
- Support newer versions of React Native. It should support from React Native 0.46 and above, however, it is recommended to use the latest React Native version (0.57.5 when this was published).
- Added types to the library. These should work with both Flow and TypeScript.
- Update the library to use the
NativeEventEmitter
. See the upgrade guide below. - Updated the README with better installation instructions and a rationale for using the library.
Upgrading
The API for listening to events has been changed. You now need to import the RNLocationEventEmitter
from the library and then call addListener
on that object.
For example:
import RNLocation, { RNLocationEventEmitter } from 'react-native-location';
RNLocation.requestAlwaysAuthorization();
RNLocation.startUpdatingLocation();
RNLocation.setDistanceFilter(5.0);
var subscription = RNLocationEventEmitter.addListener('locationUpdated', (location) => {
// TODO: Implement
});