mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
ios shared works on ipad
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user