Skip to content

Commit 76f7215

Browse files
committed
Geolocation based search added - not working now..
1 parent fccbbb5 commit 76f7215

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

ios/WeatherApp/App/Views/SearchView.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,17 @@ var SearchView = React.createClass({
114114
},
115115
handleSearchButtonPressed: function() {
116116
this.setState({isLoading: true, message: 'Gathering current weather data'});
117+
// navigator.geolocation.getCurrentPosition(
118+
// location => {
119+
// var search = location.coords.latitude + ',' + location.coords.longitude;
120+
// console.log(search);
121+
// },
122+
// error => {
123+
// this.setState({
124+
// message: 'There was a problem with obtaining your location: ' + JSON.stringify(error)
125+
// });
126+
// }
127+
// );
117128
this.fetchApiDataForCurrentWeather(this.prepareAPIUrlForCurrentWeather());
118129
},
119130
render: function() {

ios/WeatherApp/iOS/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
<string>UIInterfaceOrientationLandscapeLeft</string>
3535
<string>UIInterfaceOrientationLandscapeRight</string>
3636
</array>
37+
<key>NSLocationWhenInUseUsageDescription</key>
38+
<string>WeatherApp would like to use your location</string>
3739
<key>UIViewControllerBasedStatusBarAppearance</key>
3840
<false/>
39-
<key>NSLocationWhenInUseUsageDescription</key>
40-
<string></string>
4141
</dict>
4242
</plist>

0 commit comments

Comments
 (0)