locations track
This commit is contained in:
+2
-1
@@ -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
|
||||
@@ -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",
|
||||
|
||||
@@ -39,7 +39,7 @@ ion-header {
|
||||
}
|
||||
}
|
||||
.top-tool{
|
||||
--background: #edddcb;
|
||||
--background: #f1eeeb;
|
||||
border-radius: 10px;
|
||||
ion-buttons{
|
||||
ion-button{
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
@@ -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);
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user