mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
add checkintent to main file
This commit is contained in:
+45
-2
@@ -7,12 +7,13 @@ import { environment } from './environments/environment';
|
||||
import { defineCustomElements } from '@ionic/pwa-elements/loader';
|
||||
|
||||
import "hammerjs"; // HAMMER TIME
|
||||
import { SendIntent } from "send-intent";
|
||||
import { Filesystem } from '@capacitor/filesystem';
|
||||
|
||||
|
||||
if (environment.production) {
|
||||
enableProdMode();
|
||||
}
|
||||
|
||||
|
||||
/* Sentry.init(
|
||||
{
|
||||
dsn: 'https://5b345a3ae70b4e4da463da65881b4aaa@o4504340905525248.ingest.sentry.io/4504345615794176',
|
||||
@@ -46,5 +47,47 @@ platformBrowserDynamic().bootstrapModule(AppModule)
|
||||
.catch(err => console.log(err));
|
||||
|
||||
// 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);
|
||||
|
||||
Reference in New Issue
Block a user