starting async functionality...completed mysql rest for the most part

- need to handle longitude and latitude queries
This commit is contained in:
Arjun Patel
2018-05-27 17:54:47 -07:00
parent 0e0647986b
commit aa7574a9fc
3 changed files with 77 additions and 31 deletions
+11 -2
View File
@@ -26,8 +26,7 @@ export default class Loading extends Component<Props> {
this.latitude = parseFloat(position.coords.latitude);
this.longitude = parseFloat(position.coords.longitude);
console.log(String(this.latitude) + ' ' + String(this.longitude));
//AsyncStorage.setItem('longitude', this.longitude);
//AsyncStorage.setItem('latitude', this.latitude);
this.storeValues();
Actions.main();
},
(error) => console.log(error),
@@ -38,6 +37,16 @@ export default class Loading extends Component<Props> {
);
}
storeValues = async () => {
try {
await AsyncStorage.setItem('long', this.longitude);
await AsyncStorage.setItem('lat', this.latitude);
console.log('Stored Values!');
} catch (error) {
console.log(error);
}
}
render() {
return (
<View style={loadingStyles.container}>