mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
shared plugin added
This commit is contained in:
@@ -14,6 +14,14 @@
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="text/plain" />
|
||||
<data android:mimeType="image/*" />
|
||||
<data android:mimeType="application/*" />
|
||||
<data android:mimeType="video/*" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<provider android:authorities="${applicationId}.fileprovider" android:exported="false"
|
||||
android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
|
||||
|
||||
Generated
+7024
-2804
File diff suppressed because it is too large
Load Diff
@@ -175,6 +175,7 @@
|
||||
"rocket.chat.realtime.api.rxjs": "^2.1.1",
|
||||
"rxjs": "~6.6.3",
|
||||
"rxjs-compat": "^6.6.7",
|
||||
"send-intent": "^5.0.0",
|
||||
"sharp": "^0.30.7",
|
||||
"socket.io-client": "^2.3.0",
|
||||
"tinymce": "^6.6.0",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Event } from '../models/event.model';
|
||||
import { NotificationsService } from '../services/notifications.service';
|
||||
import { AlertController, Platform } from '@ionic/angular';
|
||||
import { AlertController, ModalController, NavParams, Platform } from '@ionic/angular';
|
||||
import { Router } from '@angular/router';
|
||||
import { ToDayEventStorage } from '../store/to-day-event-storage.service';
|
||||
import { TotalDocumentStore } from '../store/total-document.service';
|
||||
@@ -20,8 +20,12 @@ import { RouteService } from 'src/app/services/route.service';
|
||||
import { NetworkServiceService, ConnectionStatus } from 'src/app/services/network-service.service';
|
||||
import { UserSession } from '../models/user.model';
|
||||
import { PermissionList } from '../models/permission/permissionList';
|
||||
import {SendIntent} from "send-intent";
|
||||
|
||||
import { Plugins } from '@capacitor/core';
|
||||
import { Filesystem } from '@capacitor/filesystem';
|
||||
import { NewActionPage } from '../pages/publications/new-action/new-action.page';
|
||||
import { PublicationsPage } from '../pages/publications/publications.page';
|
||||
|
||||
const { App } = Plugins;
|
||||
|
||||
@@ -76,6 +80,7 @@ export class HomePage implements OnInit {
|
||||
public user: UserSession;
|
||||
permissionList = new PermissionList();
|
||||
SessionStore = SessionStore
|
||||
intent: any;
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
@@ -92,12 +97,16 @@ export class HomePage implements OnInit {
|
||||
private NetworkServiceService: NetworkServiceService,
|
||||
public eventService: EventsService,
|
||||
public ActiveTabService: ActiveTabService,
|
||||
private RoleIdService: RoleIdService
|
||||
private RoleIdService: RoleIdService,
|
||||
private modalController: ModalController,
|
||||
|
||||
) {
|
||||
if (SessionStore.exist) {
|
||||
this.user = SessionStore.user;
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.router.events.subscribe((val) => {
|
||||
document.querySelectorAll('ion-modal').forEach((e: any) => e.remove())
|
||||
document.querySelectorAll('popover-viewport').forEach((e: any) => e.remove())
|
||||
@@ -143,8 +152,40 @@ export class HomePage implements OnInit {
|
||||
|
||||
refreshing() { }
|
||||
|
||||
checkSendIntentReceived() {
|
||||
SendIntent.checkSendIntentReceived().then(async (result: any) => {
|
||||
if (result) {
|
||||
console.log('SendIntent received');
|
||||
console.log(JSON.stringify(result));
|
||||
const modal = await this.modalController.create({
|
||||
component: PublicationsPage,
|
||||
componentProps: {
|
||||
item: "item",
|
||||
intent: JSON.stringify(result)
|
||||
},
|
||||
cssClass: 'new-action modal modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
/* modal.onDidDismiss().then(() => {
|
||||
this.getActions();
|
||||
}); */
|
||||
await modal.present();
|
||||
}
|
||||
if (result.url) {
|
||||
let resultUrl = decodeURIComponent(result.url);
|
||||
Filesystem.readFile({path: resultUrl})
|
||||
.then((content) => {
|
||||
console.log(content.data);
|
||||
})
|
||||
.catch((err) => console.log(err));
|
||||
}
|
||||
}).catch(err => console.log(err));
|
||||
}
|
||||
ngOnInit() {
|
||||
|
||||
this.checkSendIntentReceived()
|
||||
|
||||
if ("serviceWorker" in navigator) {
|
||||
navigator.serviceWorker.onmessage = (event) => {
|
||||
console.log('Mensagem recebida do Service Worker:', event.data.data);
|
||||
@@ -236,20 +277,19 @@ export class HomePage implements OnInit {
|
||||
}, 1000)
|
||||
|
||||
|
||||
/* if (!this.platform.is('desktop')) {
|
||||
if (!this.platform.is('desktop')) {
|
||||
App.addListener('appStateChange', ({ isActive }) => {
|
||||
if (isActive) {
|
||||
// The app is in the foreground.
|
||||
console.log('App is in the foreground');
|
||||
this.RochetChatConnectorService.connect()
|
||||
this.reloadComponent(true)
|
||||
this.checkSendIntentReceived()
|
||||
} else {
|
||||
// The app is in the background.
|
||||
console.log('App is in the background');
|
||||
// You can perform actions specific to the background state here.
|
||||
}
|
||||
});
|
||||
} */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router, NavigationEnd } from '@angular/router';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
import { NewActionPage } from './new-action/new-action.page';
|
||||
@@ -58,6 +58,7 @@ export class PublicationsPage implements OnInit {
|
||||
hideRefreshBtn = true;
|
||||
showSlidingOptions = true;
|
||||
idSelected: string;
|
||||
intent: any;
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
@@ -68,10 +69,13 @@ export class PublicationsPage implements OnInit {
|
||||
public ThemeService: ThemeService,
|
||||
public p: PermissionService,
|
||||
private storage: Storage,
|
||||
private navParams: NavParams,
|
||||
|
||||
) {
|
||||
this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||
this.days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||
|
||||
this.intent = this.navParams.get('intent');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
Reference in New Issue
Block a user