ios shared works on ipad

This commit is contained in:
Equilibrium ITO
2024-03-01 14:37:42 +01:00
parent 1f4274e3e0
commit b9d7226de7
14 changed files with 251 additions and 96 deletions
+26 -2
View File
@@ -2,14 +2,17 @@ import { Filesystem } from '@capacitor/filesystem';
import { SendIntent } from "send-intent";
import { Router } from '@angular/router';
import { CallbackScheduler } from './callbackScheduler';
import { AlertController, Platform } from '@ionic/angular';
export class SendIntentService {
Router!: Router
callbackScheduler = new CallbackScheduler()
alertController = new AlertController()
constructor() {
constructor(
) {
SendIntent.checkSendIntentReceived().then((result: any) => {
// logger
@@ -36,11 +39,32 @@ export class SendIntentService {
private onReceive = this.callbackScheduler.function<any>((result)=> {
this.Router.navigateByUrl("/home/publications");
this.Router.navigateByUrl("/home/publications").then(() => {
if(Platform.prototype.is('ios')) {
this.alertIos();
}
});
window["sharedContent"] = result;
})
private alertIos() {
this.alertController .create({
header: 'Selecione uma acção para criar a publicação',
message: '',
buttons: [
{
text: 'Ok',
handler: () => {
}
}
]
}).then(res => {
res.present();
});
}
}
export const sendIntent = new SendIntentService()