Disabled capacitor and add camera integration

This commit is contained in:
Tiago Kayaya
2020-12-11 18:00:38 +01:00
parent 5496953f63
commit d4d08c6039
111 changed files with 182 additions and 2338 deletions
+6 -6
View File
@@ -56,24 +56,24 @@ export class AuthService {
}
//Get user data from RocketChat
getUserData(){
/* getUserData(){
this.storageService.get(AuthConnstants.AUTH).then(res=>{
this.userData$.next(res);
})
}
} */
getProfile(){
/* getProfile(){
this.storageService.get(AuthConnstants.PROFILE).then(res=>{
return res;
});
}
} */
logoutChat(){
//this.storageService.clear();
this.storageService.removeStorageItem(AuthConnstants.AUTH).then(res =>{
/* this.storageService.removeStorageItem(AuthConnstants.AUTH).then(res =>{
this.userData$.next('');
this.router.navigate(['']);
})
}) */
}
+5 -5
View File
@@ -1,14 +1,14 @@
import { Injectable } from '@angular/core';
import {
/* import {
Plugins,
PushNotification,
PushNotificationToken,
PushNotificationActionPerformed,
Capacitor
} from '@capacitor/core';
} from '@capacitor/core'; */
import { Router } from '@angular/router';
const { PushNotifications } = Plugins;
/* const { PushNotifications } = Plugins; */
@Injectable({
providedIn: 'root'
@@ -17,7 +17,7 @@ export class FcmService {
constructor(private router: Router) { }
initPush() {
/* initPush() {
if (Capacitor.platform !== 'web') {
this.registerPush();
}
@@ -58,7 +58,7 @@ export class FcmService {
}
}
);
}
} */
}
+3 -1
View File
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { Plugins, CameraResultType, Capacitor, FilesystemDirectory, CameraPhoto, CameraSource } from '@capacitor/core';
/* import { Plugins, CameraResultType, Capacitor, FilesystemDirectory, CameraPhoto, CameraSource } from '@capacitor/core'; */
import { Photo } from '../models/photo';
import { Platform } from '@ionic/angular';
import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
@@ -27,6 +27,8 @@ export class PhotoService {
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
}
this.camera.getPicture(options).then((imageData) => {
// imageData is either a base64 encoded string or a file URI
+4 -4
View File
@@ -1,13 +1,13 @@
import { Injectable } from '@angular/core';
import { Plugins } from '@capacitor/core';
const { Storage } = Plugins;
/* import { Plugins } from '@capacitor/core';
const { Storage } = Plugins; */
@Injectable({
providedIn: 'root'
})
export class StorageService {
constructor() {}
// Store the value
/* // Store the value
async store(storageKey: string, value: any) {
const encryptedValue = btoa(escape(JSON.stringify(value)));
await Storage.set({
@@ -29,5 +29,5 @@ const { Storage } = Plugins;
// Clear storage
async clear() {
await Storage.clear();
}
} */
}