improve intent with scheduler

This commit is contained in:
Peter Maquiran
2023-10-27 16:46:41 +01:00
parent a0609e5ba2
commit 1865240569
4 changed files with 180 additions and 55 deletions
+1 -43
View File
@@ -9,7 +9,7 @@ import { defineCustomElements } from '@ionic/pwa-elements/loader';
import "hammerjs"; // HAMMER TIME
import { SendIntent } from "send-intent";
import { Filesystem } from '@capacitor/filesystem';
import 'src/app/services/shareIntent'
if (environment.production) {
enableProdMode();
@@ -48,46 +48,4 @@ platformBrowserDynamic().bootstrapModule(AppModule)
// Call the element loader after the platform has been bootstrapped
SendIntent.checkSendIntentReceived().then((result: any) => {
if (result) {
console.log('SendIntent received');
console.log(JSON.stringify(result));
}
if (result.url) {
let resultUrl = decodeURIComponent(result.url);
Filesystem.readFile({path: resultUrl})
.then(async (content) => {
/* const modal = await this.modalController.create({
component: PublicationsPage,
componentProps: {
item: "item",
intent: content.data
},
cssClass: 'new-action modal modal-desktop',
backdropDismiss: false
});
modal.onDidDismiss().then(() => {
SendIntent.finish();
});
await modal.present();
*/
window["sharedintend"] = content.data
window["this.router"].navigateByUrl("/home/publication");
alert('shared')
console.log(content.data);
})
.catch((err) => console.error(err));
}
}).catch(err => console.error(err));
defineCustomElements(window);