locations track

This commit is contained in:
CHIEFSOFT\ameye
2023-10-26 20:01:22 -04:00
parent 7fa2183441
commit 958a3e64b0
6 changed files with 49 additions and 3 deletions
+2 -1
View File
@@ -67,4 +67,5 @@ $ ionic generate page contact
$ ionic generate component contact/form
$ ionic generate component login-form --change-detection=OnPush
$ ionic generate directive ripple --skip-import
$ ionic generate service user-wallet
$ ionic generate service user-wallet
ionic generate service loc-trc
+1
View File
@@ -25,6 +25,7 @@
"@capacitor/android": "5.0.5",
"@capacitor/app": "^5.0.0",
"@capacitor/core": "^5.0.0",
"@capacitor/geolocation": "^5.0.6",
"@capacitor/google-maps": "^5.3.3",
"@capacitor/haptics": "^5.0.0",
"@capacitor/ios": "5.0.5",
+1 -1
View File
@@ -39,7 +39,7 @@ ion-header {
}
}
.top-tool{
--background: #edddcb;
--background: #f1eeeb;
border-radius: 10px;
ion-buttons{
ion-button{
+5 -1
View File
@@ -5,6 +5,8 @@ import { BlogDataService } from 'src/app/store/blog-data.service';
import { WrenchService } from 'src/app/services/wrench.service';
import { OnesignalService } from 'src/app/services/onesignal.service';//
import { UserWalletService } from 'src/app/store/user-wallet.service';
import { LocTrcService } from "../../services/loc-trc.service";
//import * as stream from "stream";
@Component({
@@ -30,7 +32,8 @@ export class HomePage implements OnInit {
private wrenchService: WrenchService,
private onesignalService: OnesignalService,
public blogDataService: BlogDataService,
public userWalletService: UserWalletService
public userWalletService: UserWalletService,
private locTrcService:LocTrcService
) {
this.accountType = sessionDataProviderService.account_type;
this.firstname = this.sessionDataProviderService.firstname;
@@ -43,6 +46,7 @@ export class HomePage implements OnInit {
console.log("BLOG HOME 002->", this.blogDataService.blogData);
// this.firstname = this.sessionDataProviderService.firstname;
this.onesignalService.Init(this.sessionDataProviderService.member_uid);
this.locTrcService.startTracking();
if (this.accountType == 'FULL'){
this.getBlogData([]);
this.getBannersData();
+16
View File
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { LocTrcService } from './loc-trc.service';
describe('LocTrcService', () => {
let service: LocTrcService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(LocTrcService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
+24
View File
@@ -0,0 +1,24 @@
import { Injectable } from '@angular/core';
import { Geolocation } from '@capacitor/geolocation';
import { SessionDataProviderService } from 'src/app/store/session-data-provider.service';
@Injectable({
providedIn: 'root'
})
export class LocTrcService {
constructor(public sessionDataProviderService: SessionDataProviderService) {
}
async startTracking(){
const coordinates = await Geolocation.getCurrentPosition();
//debugger;
console.log('Current position 0000:', coordinates);
const printCurrentPosition = async () => {
const coordinates = await Geolocation.getCurrentPosition();
console.log('Current position:', coordinates);
};
}
}