mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 12:15:37 +08:00
[ReactNative] Replace console.error with alert on UIExplorer Geolocation example
Summary: @public The alert is less aggressive, otherwise it seems like the app is broken. Test Plan: Run the UIExplorer, open the Geolocation example and deny access. It should alert instead of redbox'ing
This commit is contained in:
@@ -50,8 +50,8 @@ var GeolocationExample = React.createClass({
|
|||||||
componentDidMount: function() {
|
componentDidMount: function() {
|
||||||
navigator.geolocation.getCurrentPosition(
|
navigator.geolocation.getCurrentPosition(
|
||||||
(initialPosition) => this.setState({initialPosition}),
|
(initialPosition) => this.setState({initialPosition}),
|
||||||
(error) => console.error(error),
|
(error) => alert(error.message),
|
||||||
{enableHighAccuracy: true, timeout: 100, maximumAge: 1000}
|
{enableHighAccuracy: true, timeout: 20000, maximumAge: 1000}
|
||||||
);
|
);
|
||||||
this.watchID = navigator.geolocation.watchPosition((lastPosition) => {
|
this.watchID = navigator.geolocation.watchPosition((lastPosition) => {
|
||||||
this.setState({lastPosition});
|
this.setState({lastPosition});
|
||||||
|
|||||||
Reference in New Issue
Block a user