eu tenho uma aplicaçao que exibe na tela a latitude e a longitude queria saber como gravar esses dados no firebase
meu codigo home.ts ta assim
import { Component } from '@angular/core';
import { NavController, Platform } from 'ionic-angular'; import { Geolocation, GeolocationOptions, Geoposition} from '@ionic-native/geolocation';
@Component({ selector: 'page-home', templateUrl: 'home.html' }) export class HomePage{
geoposition: Geoposition
geolocationOptions: GeolocationOptions
constructor(private platform: Platform,
private geolocation: Geolocation,
public navCtrl: NavController){
}
async getGeolocation(){
await this.platform.ready();
try {
this.geolocationOptions = {
maximumAge: 1000,
timeout: 1000,
enableHighAccuracy: true
}
this.geoposition = await this.geolocation.getCurrentPosition(this.geolocationOptions);
}
catch(e){
console.error(e)
}
}
}
o html que exibe na tela os dados
<ion-list>
<ion-item>
Accurary: {{geoposition.coords.accuracy}}
</ion-item>
<ion-item>
Latitude: {{geoposition.coords.latitude}}
</ion-item>
<ion-item>
Longitude: {{geoposition.coords.longitude}}
</ion-item>
<ion-item>
Timestamp:{{geoposition.timestamp |date}}
</ion-item>